occi-core 4.3.4 → 4.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb6afc31ced89763f478fa32dfd83e557b3835f4
4
- data.tar.gz: 85b839737d393b1ba49a8ce5dbd233410548bdf6
3
+ metadata.gz: d538f5cdea3d97838599cb47ec683aa741511fb6
4
+ data.tar.gz: c67bbd9ec02ca318d34107f9e424a11b3a2525da
5
5
  SHA512:
6
- metadata.gz: 9d6a180a9df2c866181bbeb10d9990308b072a56034b2b51bd80aa279ae4d122bd9460aa67d412500d91d92a66c328235f02d9d981f763e527639f464a6e0271
7
- data.tar.gz: cde5935763b8a68231350c57f7e3e30056bf21a4c551a2bdb2af8f951cbda31ad4f94e33fa0c1871c1465afde5d890e4b9f80685a2319b5b8e9ecadb12df78f1
6
+ metadata.gz: e3906c64af02d6dce2a806d86e21779c92842a159b67c35eb1a29d92ca57bfb853180fa2bb55333b2482407433114cbfdd94520f1cc3b0018cbde20d3ff0070d
7
+ data.tar.gz: e30e89e7765a35b16981a001b8711cfea3544392ce4e4a06e227a05a612384b50e60d7f161f2bcc74b44e35ac2e0762ce9def7ff962acb874e5530c52c790930
@@ -325,22 +325,24 @@ module Occi
325
325
  end
326
326
 
327
327
  def add_missing_attributes(attributes, definitions, set_defaults)
328
- attributes ||= Occi::Core::Attributes.new
329
-
330
328
  definitions.each_key do |key|
331
329
  next if key =~ /^_/
332
330
 
333
331
  if definitions[key].kind_of? Occi::Core::Attributes
332
+ attributes[key] = Occi::Core::Attributes.new if attributes[key].nil?
334
333
  add_missing_attributes(attributes[key], definitions[key], set_defaults)
335
334
  elsif attributes[key].nil?
336
-
337
335
  if definitions[key].default.nil?
338
336
  raise Occi::Errors::AttributeMissingError,
339
337
  "Required attribute #{key} not specified" if definitions[key].required
340
- else
341
- attributes[key] = definitions[key].default if definitions[key].required || set_defaults
338
+ elsif definitions[key].required || set_defaults
339
+ attributes[key] = definitions[key]
340
+ attributes[key] = definitions[key].default
342
341
  end
343
-
342
+ else
343
+ old_val = attributes[key]
344
+ attributes[key] = definitions[key]
345
+ attributes[key] = old_val
344
346
  end
345
347
  end
346
348
  end
@@ -1,3 +1,3 @@
1
1
  module Occi
2
- VERSION = "4.3.4" unless defined?(::Occi::VERSION)
2
+ VERSION = "4.3.5" unless defined?(::Occi::VERSION)
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
19
19
  gem.require_paths = ['lib']
20
20
 
21
21
  gem.add_dependency 'json', '>= 1.8.1', '< 3'
22
- gem.add_dependency 'hashie', '>= 3.3.1', '< 4'
22
+ gem.add_dependency 'hashie', '>= 3.3.1', '< 3.5'
23
23
  gem.add_dependency 'uuidtools', '>= 2.1.3', '< 3'
24
24
  gem.add_dependency 'activesupport', '>= 4.0.0', '< 6'
25
25
  gem.add_dependency 'settingslogic', '>= 2.0.9', '< 3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occi-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.4
4
+ version: 4.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Feldhaus
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-01-27 00:00:00.000000000 Z
13
+ date: 2017-02-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -41,7 +41,7 @@ dependencies:
41
41
  version: 3.3.1
42
42
  - - "<"
43
43
  - !ruby/object:Gem::Version
44
- version: '4'
44
+ version: '3.5'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ dependencies:
51
51
  version: 3.3.1
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '4'
54
+ version: '3.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: uuidtools
57
57
  requirement: !ruby/object:Gem::Requirement