sistero 0.5.4 → 0.6.0

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: 99a4ca2119b2a5feddeae0414d9f597c76241349
4
- data.tar.gz: 611dddb5acb699692bfa0580c5ae89daa852903a
3
+ metadata.gz: 96adaad8acc04fa6b38ed622150d5a993fb9279d
4
+ data.tar.gz: 49a8eefc611b198779728ad4ade3fa91fa82ec81
5
5
  SHA512:
6
- metadata.gz: 76743177831eb1dd930c410fb8d50d7f7c4baa924226e1fe4d6d8d7c7051bfacadff2e886b000680ad232c440e32cd022251333a511501fcfdca6890e72e1544
7
- data.tar.gz: a1921ab8216c5216cf5371aada189d4f21721aed1be6aee23e871194b83e9525acf33d510ea8e0e07405174cf6a33108951a7b87ab5d50a8d8bb2af7c0e36615
6
+ metadata.gz: c64efc4ecbfd6b30302a19805331b876facb979c5b3e50d2e18aff4c20e7c4d3c62f5e619458b2934a7cc8212c9ff3ab3769f8cae50976dad12437a2cad5968f
7
+ data.tar.gz: d7fd78c6b1605887013c5032e6c2bf0e10ac773019c70b3824ab551fdbb9572d52730e00d11617033ac377caeaeecee9fdcfe86f5af6fe37a47016b2ba9b3581
@@ -22,15 +22,13 @@ module Sistero
22
22
  attr_accessor :defaults, :profiles
23
23
 
24
24
  def profile vm_name
25
- if @defaults['vm_name'] and vm_name.nil?
26
- profile = @defaults
27
- else
28
- # TODO: also handle wildcards
29
- profile = @profiles.find do |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
@@ -1,3 +1,3 @@
1
1
  module Sistero
2
- VERSION = '0.5.4'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sistero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pike