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 +5 -1
- data/lib/occi/cli/occi_opts.rb +10 -6
- data/lib/occi/cli/version.rb +1 -1
- metadata +2 -2
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
|
-
|
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
|
data/lib/occi/cli/occi_opts.rb
CHANGED
@@ -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
|
-
|
229
|
-
|
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 = []
|
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
|
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
|
-
|
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
|
-
|
404
|
+
unless missing.empty?
|
401
405
|
if @@quiet
|
402
406
|
exit false
|
403
407
|
else
|
data/lib/occi/cli/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2013-07-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: occi-api
|