From: Martyn Taylor<mtaylor(a)redhat.com>
---
lib/aeolus_cli/command/build_command.rb | 6 +-
spec/vcr/cassettes/command/build_command/build.yml | 70 ++++++++++++++++++++
2 files changed, 74 insertions(+), 2 deletions(-)
create mode 100644 spec/vcr/cassettes/command/build_command/build.yml
diff --git a/lib/aeolus_cli/command/build_command.rb
b/lib/aeolus_cli/command/build_command.rb
index 8bd5b93..dfa4bdd 100644
--- a/lib/aeolus_cli/command/build_command.rb
+++ b/lib/aeolus_cli/command/build_command.rb
@@ -33,11 +33,13 @@ module Aeolus
template = read_template
validate_xml_schema(template)
- image = Aeolus::CLI::Image.new({:targets => @options[:target].to_s, :tdl
=> template})
+ image = Aeolus::CLI::Image.new({:targets => @options[:target] *
",", :tdl => template})
image.save!
puts "Image: " + image.id
puts "Build: " + image.build.id
- puts "Target Image: " + image.build.target_images.target_image.id
+ image.build.target_images.target_image.to_a.each do |target_image|
+ puts "Target Image: " + target_image.id.to_s + "\t :Status
" + target_image.status
+ end
quit(0)
end
end
diff --git a/spec/vcr/cassettes/command/build_command/build.yml
b/spec/vcr/cassettes/command/build_command/build.yml
new file mode 100644
index 0000000..bccd152
--- /dev/null
+++ b/spec/vcr/cassettes/command/build_command/build.yml
@@ -0,0 +1,70 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri:
https://admin:password@localhost/conductor/api/images.xml
+ body: |
+<?xml version="1.0" encoding="UTF-8"?>
+<image>
+<targets>ec2</targets>
+<tdl><template>
+<name>tmpl1</name>
+<description>foo</description>
+<os>
+<rootpw>password</rootpw>
+<name>Fedora</name>
+<arch>x86_64</arch>
+<version>14</version>
+<install type="url">
+<url>http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/os/</url>
+</install>
+</os>
+<repositories>
+<repository name="custom">
+<url>http://repos.fedorapeople.org/repos/aeolus/demo/webapp/</url>
+<signed>false</signed>
+</repository>
+</repositories>
+</template></tdl>
+</image>
+
+ headers:
+ content-type:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"c65786cb658ae9dcb74afacdfa17d01a\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Thu, 20 Oct 2011 16:30:30 GMT
+ x-runtime:
+ - "0.805774"
+ content-length:
+ - "574"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlMTA3ZjgzMWQ0ZmQ0NjRkNWEwZWJhM2MyN2ZlN2RkNGYiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--034e267cd5514827f2aaa2cd4cc99777ee5e02e9;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+<image
href='http://localhost:3000/api/images/66941cc3-7bc7-4d67-abfb-f4473fdc1243'
id='66941cc3-7bc7-4d67-abfb-f4473fdc1243'>
+<build
href='http://localhost:3000/api/builds/247fc85c-7eb9-4756-bb7a-c06d19f2da47'
id='247fc85c-7eb9-4756-bb7a-c06d19f2da47'>
+<target_images>
+<target_image
href='http://localhost:3000/api/target_images/7673bd21-3517-48c4-a282-9ea78f52573d'
id='7673bd21-3517-48c4-a282-9ea78f52573d'>
+<status>COMPLETED</status>
+<provider_images>
+</provider_images>
+</target_image>
+</target_images>
+</build>
+</image>
+
+ http_version: "1.1"
\ No newline at end of file
ACK to both
--
No trees were killed to send this message, but a large number of
electrons were terribly inconvenienced.