Browse files

[openstack|image] upload-test-image.rb example fixes

Upload AKI,ARI first then associate them to the image
  • Loading branch information...
1 parent fdffa0c commit 7539c7b2e60bbdaa0e6b85d153f8e15d759e56a9 @rubiojr committed Mar 13, 2013
Showing with 19 additions and 15 deletions.
  1. +19 −15 lib/fog/openstack/examples/image/upload-test-image.rb
View
34 lib/fog/openstack/examples/image/upload-test-image.rb
@@ -56,23 +56,27 @@
:openstack_tenant => ENV["OS_TENANT_NAME"]
})
+puts "Uploading AKI..."
+aki = image_service.images.create :name => 'cirros-0.3.0-amd64-aki',
+ :size => File.size(aki),
+ :disk_format => 'aki',
+ :container_format => 'aki',
+ :location => aki
+
+puts "Uploading ARI..."
+ari = image_service.images.create :name => 'cirros-0.3.0-amd64-ari',
+ :size => File.size(ari),
+ :disk_format => 'ari',
+ :container_format => 'ari',
+ :location => ari
+
puts "Uploading AMI..."
image_service.images.create :name => 'cirros-0.3.0-amd64',
:size => File.size(ami),
:disk_format => 'ami',
:container_format => 'ami',
- :location => ami
-
-puts "Uploading AKI..."
-image_service.images.create :name => 'cirros-0.3.0-amd64-aki',
- :size => File.size(aki),
- :disk_format => 'aki',
- :container_format => 'aki',
- :location => aki
-
-puts "Uploading ARI..."
-image_service.images.create :name => 'cirros-0.3.0-amd64-ari',
- :size => File.size(ari),
- :disk_format => 'ari',
- :container_format => 'ari',
- :location => ari
+ :location => ami,
+ :properties => {
+ 'kernel_id' => aki.id,
+ 'ramdisk_id' => ari.id
+ }

0 comments on commit 7539c7b

Please sign in to comment.