houcho 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/houcho/outerrole/cloudforecast.rb +11 -3
- data/lib/houcho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b59ced5d69133f301f1a65871fcb2cd8378ceaca
|
4
|
+
data.tar.gz: 8ac6a107ea045d6353df58264fee06e99d527848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd397c0f4a66a9ad8327b83691cf2b0b77298c9611281c65835fcb9eab166fda6905c5c8de338d1b2ee10538f435c63460e1e2937011cc5740b2f39f265dc8c6
|
7
|
+
data.tar.gz: 9ea002fe75a457d41f320a9eb38d9a53fb875a0bb4b6c0c645f877e1e374a600546c685bd1db0c6fd8b64d412975e579ae7bb5a11d574b58ef2a91b7eda6ab82
|
@@ -11,15 +11,17 @@ class OuterRole
|
|
11
11
|
class << CloudForecast
|
12
12
|
def load
|
13
13
|
cfdir = Houcho::Config::CFYAMLDIR
|
14
|
+
@cfrole = {}
|
14
15
|
|
15
16
|
Dir::entries(cfdir).each do |file|
|
16
17
|
next if file !~ /\.yaml$/
|
17
18
|
yaml = "#{cfdir}/#{file}"
|
18
19
|
group = load_group(yaml)
|
19
20
|
cfrole = create_cf_role(yaml, group)
|
20
|
-
|
21
|
-
save_outer_role(cfrole, "CloudForecast")
|
21
|
+
merge_cf_role(cfrole)
|
22
22
|
end
|
23
|
+
|
24
|
+
save_outer_role(@cfrole, "CloudForecast")
|
23
25
|
end
|
24
26
|
|
25
27
|
|
@@ -49,7 +51,7 @@ class OuterRole
|
|
49
51
|
doc["servers"].each do |servers|
|
50
52
|
label = servers["label"].gsub(/\s+/, '_') if servers["label"]
|
51
53
|
outerrole = "#{group[i]}::#{label}::#{servers["config"].sub(/\.yaml$/, "")}"
|
52
|
-
hosts = servers["hosts"].map { |host| host.split(/\s+/)[1] }
|
54
|
+
hosts = (servers["hosts"] || []).map { |host| host.split(/\s+/)[1] }
|
53
55
|
|
54
56
|
cfrole[outerrole] = hosts
|
55
57
|
end
|
@@ -57,6 +59,12 @@ class OuterRole
|
|
57
59
|
|
58
60
|
cfrole
|
59
61
|
end
|
62
|
+
|
63
|
+
def merge_cf_role(cfrole)
|
64
|
+
cfrole.each do |role, hosts|
|
65
|
+
@cfrole[role] = @cfrole[role] ? @cfrole[role].concat(hosts).uniq : hosts
|
66
|
+
end
|
67
|
+
end
|
60
68
|
end
|
61
69
|
end
|
62
70
|
|
data/lib/houcho/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: houcho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi SUZUKI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|