soar_sc_core 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 493ffc8bb6a76956d2e60b63a2288adcf018b5d7
4
- data.tar.gz: 1c342973c86b8dbd54eddd47b756224fe8f56321
3
+ metadata.gz: c6d53da3c35fdb6e5a17284f7acddce410943cd2
4
+ data.tar.gz: cacb2344be187c21166e5ad14e5dc269fb7de07c
5
5
  SHA512:
6
- metadata.gz: df555dd5eafa6fc99f54e84981cd84620718cd8d7d79a11a9009f67221698b6f849fb1ba1be09a2fe413714b5179e2c358b4db9ab031599bc73549a16c0c6deb
7
- data.tar.gz: 8c94bf377246c090f2c2813ec77ab976f1c8d342ce072a531e3486debe941a01a86f46b78a2a4e8aceb27429e875a9c63af92338a39045f062276245c756c723
6
+ metadata.gz: 37369d0e7cbf98d71fd09cc9cd79e10c1c3cb694521a492622b6ecf35fdfba82a8555a12f968816aa915272f2cebb3ee5d906207f7386686110650407384ca90
7
+ data.tar.gz: dd1daeec5c39e124a62c1b51f02026124e41850bf994e04265608a2ff81f26734019976094025aa9184e13311b710d0e90fb2859f93c469741686ebefc03b7cc
@@ -3,14 +3,20 @@ module SoarSc
3
3
  class ServiceRegistry
4
4
  def self.bootstrap(config)
5
5
  begin
6
- credentials = { 'username' => 'uddi', 'password' => 'read-only' }
7
- registry = config['service_registry']['uri'] if config['service_registry']
8
- registry = SoarSc::environment['SERVICE_REGISTRY'] if SoarSc::environment['SERVICE_REGISTRY']
9
- SoarSc::auditing.info("Using registry at [#{registry}]",SoarSc::startup_flow_id)
10
- SoarSc::auditing.error("No service registry! Missing service registry URI",SoarSc::startup_flow_id) if ((registry.nil?) or ('' == registry))
11
- freshness = 3600
12
- freshness = config['service_registry']['freshness'] if config['service_registry'] and config['service_registry']['freshness']
13
- SoarSc::service_registry = SoarSr::ServiceRegistry.new(registry, 'hetzner.co.za', 'hetzner', credentials, freshness)
6
+ if SoarSc::dependencies.include?("service_registry")
7
+ SoarSc::auditing.info("Using registry from configured dependencies", SoarSc::startup_flow_id)
8
+ SoarSc::service_registry = SoarSc::dependencies["service_registry"]
9
+ else
10
+ credentials = { 'username' => 'uddi', 'password' => 'read-only' }
11
+ registry = config['service_registry']['uri'] if config['service_registry']
12
+ registry = SoarSc::environment['SERVICE_REGISTRY'] if SoarSc::environment['SERVICE_REGISTRY']
13
+ SoarSc::auditing.info("Using registry at [#{registry}]",SoarSc::startup_flow_id)
14
+ SoarSc::auditing.error("No service registry! Missing service registry URI",SoarSc::startup_flow_id) if ((registry.nil?) or ('' == registry))
15
+ freshness = 3600
16
+ freshness = config['service_registry']['freshness'] if config['service_registry'] and config['service_registry']['freshness']
17
+ SoarSc::service_registry = SoarSr::ServiceRegistry.new(registry, 'hetzner.co.za', 'hetzner', credentials, freshness)
18
+ end
19
+
14
20
  config['service_registry']['warm_up'].each do |service_identifier|
15
21
  SoarSc::auditing.info("SoarSc::Provider::ServiceRegistry Warming up #{service_identifier}",SoarSc::startup_flow_id)
16
22
  SoarSc::service_registry.services.service_by_name(service_identifier)
@@ -1,3 +1,3 @@
1
1
  module SoarScCore
2
- VERSION = "0.9.0"
2
+ VERSION = "0.10.0"
3
3
  end
data/lib/soar_sc_core.rb CHANGED
@@ -42,6 +42,7 @@ def require_auth
42
42
  end
43
43
 
44
44
  def require_models
45
+ require 'soar/dependency_container'
45
46
  require 'soar_configured_factory'
46
47
  Dir["#{Dir.pwd}/lib/web/models/*.rb"].each {|file| require file }
47
48
  end
@@ -138,8 +139,6 @@ module SoarSc
138
139
  end
139
140
 
140
141
  @dependencies
141
- rescue
142
- return nil
143
142
  end
144
143
 
145
144
  def self.bootstrap_sessions(stack)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_sc_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst Van Graan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-25 00:00:00.000000000 Z
11
+ date: 2016-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml