cloudscale 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a07957c059e3e1c75fefb1a79e9f56e2e49f47e2
|
4
|
+
data.tar.gz: 7dc1299feeebd1098edd361f92caf9dfc3057af2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f653403bd281f41c3eb9aed46b40c37b732999f968719fad63c690546885e946f3d3efc5dca20bdf16da41e24afe41f34b4883c6983517cdb73aa74934f2e7a6
|
7
|
+
data.tar.gz: 497ca67326712445f8a7bb87bd79519971c12d68dce3db3580b17b18faf41ec3b221fa7862ed7e1f576232c90fe20ba544fc6b392342432f61d81ec965361ed9
|
@@ -8,19 +8,19 @@ require "yaml/store"
|
|
8
8
|
module Cloudscale
|
9
9
|
module Constants
|
10
10
|
class AgentInstance
|
11
|
-
|
11
|
+
|
12
12
|
@@AGENT_INSTANCE_STORE_PATH = "#{File.dirname(__FILE__)}/../../../store/agent/agent_instance.store"
|
13
|
-
|
13
|
+
|
14
14
|
def self.create(hash)
|
15
15
|
settings = YAML::Store.new(@@AGENT_INSTANCE_STORE_PATH)
|
16
|
-
|
16
|
+
|
17
17
|
settings.transaction {
|
18
18
|
hash.each { | key, value |
|
19
19
|
settings[key] = value
|
20
20
|
}
|
21
21
|
}
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
def self.load
|
25
25
|
begin
|
26
26
|
YAML.load(File.read(@@AGENT_INSTANCE_STORE_PATH))
|
@@ -29,14 +29,13 @@ module Cloudscale
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
32
|
def self.remove
|
34
33
|
file = File.read(@@AGENT_INSTANCE_STORE_PATH)
|
35
34
|
if (file)
|
36
35
|
File.delete(@@AGENT_INSTANCE_STORE_PATH)
|
37
36
|
end
|
38
37
|
end
|
39
|
-
|
38
|
+
|
40
39
|
end
|
41
40
|
end
|
42
|
-
end
|
41
|
+
end
|
data/lib/cloudscale/registry.rb
CHANGED
@@ -27,7 +27,8 @@ module Cloudscale
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def agent_instance_id
|
30
|
-
|
30
|
+
agent_config = Constants::AgentInstance.load
|
31
|
+
if agent_config != nil then instance_id = agent_config["agentInstanceId"] end
|
31
32
|
if (instance_id == nil)
|
32
33
|
return @generated_instance_id
|
33
34
|
else
|
data/lib/cloudscale/version.rb
CHANGED