occi-cli 4.0.0.beta.1 → 4.0.0.beta.2

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.
@@ -90,7 +90,9 @@ module Occi::Cli
90
90
  Occi::Log.debug "with links: #{options.links}"
91
91
 
92
92
  options.links.each do |link|
93
- link = options.endpoint.chomp('/') + link unless link.start_with? options.endpoint
93
+ if link.start_with? options.endpoint
94
+ link.gsub!(options.endpoint.chomp('/'), '')
95
+ end
94
96
 
95
97
  if link.include? "/storage/"
96
98
  Occi::Log.debug "Adding storagelink to #{options.resource}"
@@ -155,8 +157,10 @@ module Occi::Cli
155
157
  end
156
158
  end
157
159
 
158
- #TODO: set other attributes
160
+ # TODO: set other attributes
161
+ # TODO: OCCI-OS uses occi.compute.hostname instead of title
159
162
  res.title = options.attributes[:title]
163
+ res.hostname = options.attributes[:title]
160
164
 
161
165
  Occi::Log.debug "Creating #{options.resource}:\n#{res.inspect}"
162
166
 
@@ -163,6 +163,10 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
163
163
  "--resource RESOURCE",
164
164
  String,
165
165
  "Resource to be queried (e.g. network, compute, storage etc.), required") do |resource|
166
+ # TODO: find a way to remove this OCCI-OS compatibility hack
167
+ resource = 'os_tpl' if resource == 'os'
168
+ resource = 'resource_tpl' if resource == 'resource'
169
+
166
170
  options.resource = resource
167
171
  end
168
172
 
@@ -199,7 +203,7 @@ occi --endpoint https://localhost:3300/ --action delete --resource /compute/65sd
199
203
  end
200
204
 
201
205
  if symbol == :user_data
202
- context_data = Base64.encode64(context_data)
206
+ context_data = Base64.encode64(context_data).gsub("\n", '')
203
207
  end
204
208
 
205
209
  options.context_vars[symbol] = context_data.strip
@@ -1,5 +1,5 @@
1
1
  module Occi
2
2
  module Cli
3
- VERSION = "4.0.0.beta.1" unless defined?(::Occi::Cli::VERSION)
3
+ VERSION = "4.0.0.beta.2" 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.beta.1
4
+ version: 4.0.0.beta.2
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-28 00:00:00.000000000 Z
14
+ date: 2013-08-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: occi-api