Skip to content

Commit ba458b7

Browse files
author
Jim Crossley
committed
Fork deltacloud to allow client to accept :keyname and :user_data when creating instances.
1 parent 61da352 commit ba458b7

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright (C) 2009 Red Hat, Inc.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation; either
7+
# version 2.1 of the License, or (at your option) any later version.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
18+
19+
Gem::Specification.new do |s|
20+
s.author = 'Red Hat, Inc.'
21+
s.homepage = "http://www.deltacloud.org"
22+
s.email = '[email protected]'
23+
s.name = 'jcrossley-deltacloud-client'
24+
s.description = %q{Deltacloud REST Client for API}
25+
s.version = '0.0.3.1'
26+
s.summary = %q{Deltacloud REST Client}
27+
s.files = Dir['Rakefile', 'credentials.yml', 'lib/**/*.rb', 'init.rb', 'bin/deltacloudc']
28+
s.bindir = 'bin'
29+
s.executables = 'deltacloudc'
30+
s.default_executable = 'deltacloudc'
31+
s.test_files= Dir.glob("specs/**/**")
32+
s.extra_rdoc_files = Dir["COPYING"]
33+
34+
s.add_dependency('rest-client', '>= 1.3.1')
35+
end

client/lib/deltacloud.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,14 @@ def create_instance(image_id, opts={})
276276
name = opts[:name]
277277
realm_id = opts[:realm]
278278

279-
params = {}
279+
params = opts.dup
280280
( params[:realm_id] = realm_id ) if realm_id
281281
( params[:name] = name ) if name
282282

283283
if opts[:hardware_profile].is_a?(String)
284284
params[:hwp_id] = opts[:hardware_profile]
285285
elsif opts[:hardware_profile].is_a?(Hash)
286+
params.delete(:hardware_profile)
286287
opts[:hardware_profile].each do |k,v|
287288
params[:"hwp_#{k}"] = v
288289
end

0 commit comments

Comments
 (0)