sistero 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sistero/config.rb +9 -10
- data/lib/sistero/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96adaad8acc04fa6b38ed622150d5a993fb9279d
|
4
|
+
data.tar.gz: 49a8eefc611b198779728ad4ade3fa91fa82ec81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c64efc4ecbfd6b30302a19805331b876facb979c5b3e50d2e18aff4c20e7c4d3c62f5e619458b2934a7cc8212c9ff3ab3769f8cae50976dad12437a2cad5968f
|
7
|
+
data.tar.gz: d7fd78c6b1605887013c5032e6c2bf0e10ac773019c70b3824ab551fdbb9572d52730e00d11617033ac377caeaeecee9fdcfe86f5af6fe37a47016b2ba9b3581
|
data/lib/sistero/config.rb
CHANGED
@@ -22,15 +22,13 @@ module Sistero
|
|
22
22
|
attr_accessor :defaults, :profiles
|
23
23
|
|
24
24
|
def profile vm_name
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
profile
|
30
|
-
profile.vm_name == vm_name
|
31
|
-
end
|
32
|
-
raise "could not find profile for #{vm_name}" unless profile
|
25
|
+
vm_name ||= @defaults['vm_name']
|
26
|
+
raise "must set a default vm_name or specify one" unless vm_name
|
27
|
+
# TODO: also handle wildcards
|
28
|
+
profile = @profiles.find do |profile|
|
29
|
+
profile.vm_name == vm_name
|
33
30
|
end
|
31
|
+
raise "could not find profile for #{vm_name}" unless profile
|
34
32
|
profile
|
35
33
|
end
|
36
34
|
|
@@ -54,6 +52,8 @@ module Sistero
|
|
54
52
|
|
55
53
|
@profiles = cfg['profiles'].map do |profile_cfg|
|
56
54
|
profile = Profile.new *@defaults
|
55
|
+
profile.vm_name = nil
|
56
|
+
|
57
57
|
profile_cfg.each do |key, value|
|
58
58
|
profile[key] = value
|
59
59
|
end
|
@@ -67,10 +67,9 @@ module Sistero
|
|
67
67
|
end
|
68
68
|
profile.user_data = user_data
|
69
69
|
end
|
70
|
+
raise "every profile must have a vm_name field" unless profile.vm_name
|
70
71
|
profile
|
71
72
|
end
|
72
|
-
|
73
|
-
@profiles.push(@defaults) if @defaults.vm_name
|
74
73
|
end
|
75
74
|
|
76
75
|
def to_s
|
data/lib/sistero/version.rb
CHANGED