dop_common 0.13.0 → 0.14.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/doc/plan_format_v0.0.1.md +8 -0
- data/lib/dop_common/node.rb +15 -0
- data/lib/dop_common/version.rb +1 -1
- data/spec/dop_common/node_spec.rb +50 -0
- 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: c15d0fe20ed0740ebe9d3b1debfe09ef0945c2e6
|
4
|
+
data.tar.gz: ccc70b223bfa575dd4368cf27a3c7baaa0c07d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4c0719e3f0860ceba109103b458d8199d5bd703d730b6b2ab190687e99bafeca9782c2a1e39a7bc6e24135bcd81df7ea5160706f0e0aebabaf04d3b105a939
|
7
|
+
data.tar.gz: c2cf097514d33f5fc44726616487cf61b9d74c1fe527cc52485771fc411e90ed7d54f94fed99858fc314010f0fb01ff75f29127c704401a41186e288078bd197
|
data/CHANGELOG.md
CHANGED
@@ -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.14.0] - 2017-04-24
|
5
|
+
### Added
|
6
|
+
- Add node property thin_clone for vmware
|
7
|
+
|
4
8
|
## [0.13.0] - 2017-03-28
|
5
9
|
### Added
|
6
10
|
- Moved thread context logger from dopi to dop_common and reworked it so it is
|
data/doc/plan_format_v0.0.1.md
CHANGED
@@ -548,6 +548,14 @@ a property name is actually a keyword of a node hash.
|
|
548
548
|
1. __*name_servers*__ - a list of valid IP addresses.
|
549
549
|
2. __*search_domains*__ - a list of valid domains.
|
550
550
|
|
551
|
+
17. __*thin_clone*__ - an optional, VSphere-specific boolean property that instructs the VSphere provider:
|
552
|
+
1. To transform all disks from a template as thin provision (sparse) if set to `true`.
|
553
|
+
2. To transform all disks from a template as thick provision (flat) if set to `false`.
|
554
|
+
|
555
|
+
The default (unset) leaves disks as defined in given template (no explicit transformation).
|
556
|
+
|
557
|
+
__IMPORTANT__: Do not use this property for other cloud provider types than VSphere.
|
558
|
+
|
551
559
|
The example bellow shows a specification for a database backend and a web node:
|
552
560
|
```yaml
|
553
561
|
nodes:
|
data/lib/dop_common/node.rb
CHANGED
@@ -66,6 +66,7 @@ module DopCommon
|
|
66
66
|
log_validation_method('infrastructure_properties_valid?')
|
67
67
|
log_validation_method('image_valid?')
|
68
68
|
log_validation_method('full_clone_valid?')
|
69
|
+
log_validation_method('thin_clone_valid?')
|
69
70
|
log_validation_method('interfaces_valid?')
|
70
71
|
log_validation_method('flavor_valid?')
|
71
72
|
log_validation_method('cores_valid?')
|
@@ -140,6 +141,11 @@ module DopCommon
|
|
140
141
|
end
|
141
142
|
alias_method :full_clone, :full_clone?
|
142
143
|
|
144
|
+
def thin_clone?
|
145
|
+
@thin_clone ||= thin_clone_valid? ? @hash[:thin_clone] : nil
|
146
|
+
end
|
147
|
+
alias_method :thin_clone, :thin_clone?
|
148
|
+
|
143
149
|
def interfaces
|
144
150
|
@interfaces ||= interfaces_valid? ? create_interfaces : []
|
145
151
|
end
|
@@ -261,6 +267,15 @@ module DopCommon
|
|
261
267
|
true
|
262
268
|
end
|
263
269
|
|
270
|
+
def thin_clone_valid?
|
271
|
+
return false if @hash[:thin_clone].nil?
|
272
|
+
raise PlanParsingError, "Node #{@node}: The 'thin_clone' can be used only for VSphere provider" unless
|
273
|
+
(infrastructure.provides?(:vsphere) || infrastructure.provides?(:vmware))
|
274
|
+
raise PlanParsingError, "Node #{@node}: The 'thin_clone', if defined, must be true or false" unless
|
275
|
+
@hash.has_key?(:thin_clone) && (@hash[:thin_clone].kind_of?(TrueClass) || @hash[:thin_clone].kind_of?(FalseClass))
|
276
|
+
true
|
277
|
+
end
|
278
|
+
|
264
279
|
def interfaces_valid?
|
265
280
|
return false if @hash[:interfaces].nil?
|
266
281
|
@hash[:interfaces].kind_of?(Hash) or
|
data/lib/dop_common/version.rb
CHANGED
@@ -213,6 +213,56 @@ describe DopCommon::Node do
|
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
216
|
+
describe '#thin_clone' do
|
217
|
+
it 'will return nil for VSphere provider if unspecified' do
|
218
|
+
node = DopCommon::Node.new(
|
219
|
+
'dummy',
|
220
|
+
{'infrastructure' => 'vsphere'},
|
221
|
+
{:parsed_infrastructures => @infrastructures}
|
222
|
+
)
|
223
|
+
expect(node.thin_clone).to be_nil
|
224
|
+
end
|
225
|
+
it 'will return a boolean value if specified properly' do
|
226
|
+
node = DopCommon::Node.new(
|
227
|
+
'dummy',
|
228
|
+
{'infrastructure' => 'vsphere', 'thin_clone' => true},
|
229
|
+
{:parsed_infrastructures => @infrastructures}
|
230
|
+
)
|
231
|
+
expect(node.thin_clone).to be true
|
232
|
+
node = DopCommon::Node.new(
|
233
|
+
'dummy',
|
234
|
+
{'infrastructure' => 'vsphere', 'thin_clone' => false},
|
235
|
+
{:parsed_infrastructures => @infrastructures}
|
236
|
+
)
|
237
|
+
expect(node.thin_clone).to be false
|
238
|
+
end
|
239
|
+
it 'will raise an error if "thin_clone" is of invalid type' do
|
240
|
+
node = DopCommon::Node.new(
|
241
|
+
'dummy',
|
242
|
+
{'infrastructure' => 'vsphere', 'thin_clone' => :invalid},
|
243
|
+
{:parsed_infrastructures => @infrastructures}
|
244
|
+
)
|
245
|
+
expect{node.thin_clone}.to raise_error DopCommon::PlanParsingError
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'will return nil in case of invalid provider type' do
|
249
|
+
node = DopCommon::Node.new(
|
250
|
+
'dummy',
|
251
|
+
{'infrastructure' => 'rhev'},
|
252
|
+
{:parsed_infrastructures => @infrastructures}
|
253
|
+
)
|
254
|
+
expect(node.thin_clone).to be_nil
|
255
|
+
end
|
256
|
+
it 'will raise an error if "thin_clone" specified in case of invalid provider type' do
|
257
|
+
node = DopCommon::Node.new(
|
258
|
+
'dummy',
|
259
|
+
{'infrastructure' => 'rhev', 'thin_clone' => false},
|
260
|
+
{:parsed_infrastructures => @infrastructures}
|
261
|
+
)
|
262
|
+
expect{node.thin_clone}.to raise_error DopCommon::PlanParsingError
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
216
266
|
describe '#interfaces' do
|
217
267
|
it 'will return an array of interfaces if specified correctly' do
|
218
268
|
node = DopCommon::Node.new(
|
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.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Zuber
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashdiff
|