occi-cli 4.0.0.alpha.3 → 4.0.0.alpha.4

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.
data/bin/occi CHANGED
@@ -246,7 +246,11 @@ begin
246
246
  mixin = ask("What mixin should I mix in? ") { |q| q.validate = /^\S+?#\S+$/ }
247
247
  parts = mixin.split("#")
248
248
 
249
- options.mixins[parts[0]] = [] if options.mixins[parts[0]].nil?
249
+ # TODO: find a way to remove this OCCI-OS compatibility hack
250
+ parts[0] = 'os_tpl' if parts[0] == 'os'
251
+ parts[0] = 'resource_tpl' if parts[0] == 'resource'
252
+
253
+ options.mixins[parts[0]] = [] unless options.mixins[parts[0]]
250
254
  options.mixins[parts[0]] << parts[1]
251
255
  end
252
256
  end
@@ -225,8 +225,12 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
225
225
 
226
226
  parts = parts.to_a.drop(1)
227
227
 
228
- options.mixins = {} if options.mixins.nil?
229
- options.mixins[parts[0]] = [] if options.mixins[parts[0]].nil?
228
+ # TODO: find a way to remove this OCCI-OS compatibility hack
229
+ parts[0] = 'os_tpl' if parts[0] == 'os'
230
+ parts[0] = 'resource_tpl' if parts[0] == 'resource'
231
+
232
+ options.mixins = {} unless options.mixins
233
+ options.mixins[parts[0]] = [] unless options.mixins[parts[0]]
230
234
  options.mixins[parts[0]] << parts[1]
231
235
  end
232
236
 
@@ -238,7 +242,7 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
238
242
 
239
243
  raise ArgumentError, "Specified link URI is not valid!" unless link_relative_path.start_with? '/'
240
244
 
241
- options.links = [] if options.links.nil?
245
+ options.links = [] unless options.links
242
246
  options.links << link_relative_path
243
247
  end
244
248
 
@@ -371,7 +375,7 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
371
375
  end
372
376
 
373
377
  if options.action == :create
374
- if !options.links.nil?
378
+ if options.links
375
379
  mandatory << :links
376
380
  else
377
381
  mandatory << :mixins
@@ -392,12 +396,12 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
392
396
  end
393
397
 
394
398
  def self.check_hash(hash, mandatory, opts)
395
- if !hash.is_a? Hash
399
+ unless hash.is_a?(Hash)
396
400
  hash = hash.marshal_dump
397
401
  end
398
402
 
399
403
  missing = mandatory.select{ |param| hash[param].nil? }
400
- if !missing.empty?
404
+ unless missing.empty?
401
405
  if @@quiet
402
406
  exit false
403
407
  else
@@ -1,5 +1,5 @@
1
1
  module Occi
2
2
  module Cli
3
- VERSION = "4.0.0.alpha.3" unless defined?(::Occi::Cli::VERSION)
3
+ VERSION = "4.0.0.alpha.4" unless defined?(::Occi::Cli::VERSION)
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: occi-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha.3
4
+ version: 4.0.0.alpha.4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-07-26 00:00:00.000000000 Z
14
+ date: 2013-07-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: occi-api