dop_common 0.15.2 → 0.15.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NWFiYTM0NDlhNjg1ODcwNGQ2ZjJiNjM1ZTc2Yjc2ZDgwYTU0ZGZmNg==
5
- data.tar.gz: !binary |-
6
- MjJkN2YwYWZlODRhYzNkN2E5NTU1ZTIyM2Q1ZGQ1Zjg5ZDQ5NDlhYg==
2
+ SHA1:
3
+ metadata.gz: b1d23f4b32529fed2f37e0cae88c668e11b710c6
4
+ data.tar.gz: 22733cca1544d803c2a5ffc2d1378137f543f583
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZDkyODg2YmNjYWY4Yjg2YTg2NWVmNDFkNGI5ZmZmNDIyODIxOTZlZTcyZjhh
10
- N2RlNTJmMDEzNmExNzAxNTgyZGZlMzlhMTEzNjgwODE3MWY5ZWFlZTYyNzIy
11
- ZjdmN2Y3ZTBiZjNmMzA5N2M2NTJiZjc1MDhkOGU4MjVjNDlmMTc=
12
- data.tar.gz: !binary |-
13
- MTZiZjZlNjk4OTY1NGYzNWQ2NDJkZTM1MWZmZWQ4OTZkN2I5YzlmOWQyMmMx
14
- ZDUwZGNlMjc2YTk3NjY1NjJiMjAwZDcxYjIxMmNjNTk5MGJhZGM3YzY2ZGNl
15
- N2EzMmRhNjRlNzQ0Nzg4ODAzY2JmZGQ2MTg0YTBhMWUxNzlhZTQ=
6
+ metadata.gz: d89256d49344be443aa8b063344edaaa4f8e3e1ffcda04b9292aee9080410f59630c63dd07859977ac1a4fee82e39d834c5dccb1b495c5a84d570e84462d582b
7
+ data.tar.gz: a3f857624c6d4abdf3e02920183b8edb0dc77cfc8d57f5a2691cb48b377ae6f1de1c6ef57aa57b7de8fadce012a758320aab5a20e1305db2f1c7cf5ac57926af
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  All notable changes to dop_common will be documented in this file.
3
3
 
4
+ ## [0.15.3]
5
+ ### Added
6
+ - Add node property `force_stop`
7
+
4
8
  ## [0.15.2]
5
9
  ### Added
6
10
  - Add node list property tags for vmware / vsphere
@@ -562,6 +562,9 @@ a property name is actually a keyword of a node hash.
562
562
  __IMPORTANT__: Do not use this property for other cloud provider types than VSphere.
563
563
  __IMPORTANT__: Requires minimum version 6.0.0 of VSphere.
564
564
  __IMPORTANT__: Raises an error if the tag does not exist.
565
+
566
+ 17. __*force_stop*__ - an optional boolean property to force shutdown e.g. during undeploying.
567
+ It is `false` by default.
565
568
 
566
569
 
567
570
  The example bellow shows a specification for a database backend and a web node:
@@ -79,6 +79,7 @@ module DopCommon
79
79
  log_validation_method('dns_valid?')
80
80
  log_validation_method('data_disks_valid?')
81
81
  log_validation_method('tags_valid?')
82
+ log_validation_method('force_stop_valid?')
82
83
  try_validate_obj("Node #{@name}: Can't validate the interfaces part because of a previous error"){interfaces}
83
84
  try_validate_obj("Node #{@name}: Can't validate the infrastructure_properties part because of a previous error"){infrastructure_properties}
84
85
  try_validate_obj("Node #{@name}: Can't validate the dns part because of a previous error"){dns}
@@ -199,6 +200,11 @@ module DopCommon
199
200
  @tags ||= tags_valid? ? create_tags : nil
200
201
  end
201
202
 
203
+ def force_stop?
204
+ @force_stop ||= force_stop_valid? ? @hash[:force_stop] : false
205
+ end
206
+ alias_method :force_stop, :force_stop?
207
+
202
208
  protected
203
209
 
204
210
  attr_writer :name
@@ -471,11 +477,17 @@ module DopCommon
471
477
  end
472
478
  end
473
479
 
474
-
475
480
  def create_tags
476
481
  [@hash[:tags]].flatten.map do |tag|
477
482
  tag.to_s
478
483
  end
479
484
  end
485
+
486
+ def force_stop_valid?
487
+ return false if @hash[:force_stop].nil?
488
+ raise PlanParsingError, "Node #{@node}: The 'force_stop', if defined, must be true or false" unless
489
+ @hash.has_key?(:force_stop) && (@hash[:force_stop].kind_of?(TrueClass) || @hash[:force_stop].kind_of?(FalseClass))
490
+ true
491
+ end
480
492
  end
481
493
  end
@@ -1,3 +1,3 @@
1
1
  module DopCommon
2
- VERSION = '0.15.2'
2
+ VERSION = '0.15.3'
3
3
  end
@@ -721,4 +721,37 @@ describe DopCommon::Node do
721
721
  expect{node.tags}.to raise_error DopCommon::PlanParsingError
722
722
  end
723
723
  end
724
+
725
+ describe '#force_stop' do
726
+ it 'will return a boolean value if specified properly' do
727
+ node = DopCommon::Node.new(
728
+ 'dummy',
729
+ {'force_stop' => true},
730
+ {:parsed_infrastructures => @infrastructures}
731
+ )
732
+ expect(node.force_stop).to be true
733
+
734
+ node = DopCommon::Node.new(
735
+ 'dummy',
736
+ {'force_stop' => false},
737
+ {:parsed_infrastructures => @infrastructures}
738
+ )
739
+ expect(node.force_stop).to be false
740
+
741
+ node = DopCommon::Node.new(
742
+ 'dummy',
743
+ {},
744
+ {:parsed_infrastructures => @infrastructures}
745
+ )
746
+ expect(node.force_stop).to be false
747
+ end
748
+ it 'will raise an error if "force_stop" is of invalid type' do
749
+ node = DopCommon::Node.new(
750
+ 'dummy',
751
+ {'force_stop' => :invalid},
752
+ {:parsed_infrastructures => @infrastructures}
753
+ )
754
+ expect{node.force_stop}.to raise_error DopCommon::PlanParsingError
755
+ end
756
+ end
724
757
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dop_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Zuber
@@ -9,185 +9,186 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-28 00:00:00.000000000 Z
12
+ date: 2019-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashdiff
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.3'
21
- - - ! '>='
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.3.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ~>
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0.3'
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.3.1
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: lockfile
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rb-inotify
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.9'
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.9'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: bundler
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: rspec
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rspec-legacy_formatters
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: rspec-mocks
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: rspec-collection_matchers
134
134
  requirement: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: simplecov
148
148
  requirement: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  type: :development
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ! '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: pry
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ! '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: pry-doc
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ! '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ! '>='
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
- description: ! " This gem is part of the Deployment and Orchestration for Puppet\n
189
- \ or DOP for short. dop_common is a library for the parsing and\n validation
190
- of DOP plan files.\n"
188
+ description: |2
189
+ This gem is part of the Deployment and Orchestration for Puppet
190
+ or DOP for short. dop_common is a library for the parsing and
191
+ validation of DOP plan files.
191
192
  email:
192
193
  - zuber@puzzle.ch
193
194
  - pavol.dilung@swisscom.com
@@ -196,9 +197,9 @@ executables:
196
197
  extensions: []
197
198
  extra_rdoc_files: []
198
199
  files:
199
- - .gitignore
200
- - .rspec
201
- - .ruby-version
200
+ - ".gitignore"
201
+ - ".rspec"
202
+ - ".ruby-version"
202
203
  - CHANGELOG.md
203
204
  - Gemfile
204
205
  - LICENSE.txt
@@ -298,13 +299,12 @@ require_paths:
298
299
  - lib
299
300
  required_ruby_version: !ruby/object:Gem::Requirement
300
301
  requirements:
301
- - - ! '>='
302
+ - - ">="
302
303
  - !ruby/object:Gem::Version
303
- version: !binary |-
304
- MS44Ljc=
304
+ version: 1.8.7
305
305
  required_rubygems_version: !ruby/object:Gem::Requirement
306
306
  requirements:
307
- - - ! '>='
307
+ - - ">="
308
308
  - !ruby/object:Gem::Version
309
309
  version: '0'
310
310
  requirements: []