The command should be calling TargetImage and not ProviderImage to check build status.
---
lib/aeolus_cli/command/status_command.rb | 2 +-
spec/command/status_command_spec.rb | 4 +-
.../command/status_command/targetimage.yml | 24 +++++++++++++------
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/lib/aeolus_cli/command/status_command.rb
b/lib/aeolus_cli/command/status_command.rb
index a3f5a6a..d37e9a2 100644
--- a/lib/aeolus_cli/command/status_command.rb
+++ b/lib/aeolus_cli/command/status_command.rb
@@ -25,7 +25,7 @@ module Aeolus
def run
begin
if @options[:targetimage]
- ti = Aeolus::CLI::ProviderImage.find(@options[:targetimage])
+ ti = Aeolus::CLI::TargetImage.find(@options[:targetimage])
puts "Build Status: " + ti.status
elsif @options[:providerimage]
pi = Aeolus::CLI::ProviderImage.find(@options[:providerimage])
diff --git a/spec/command/status_command_spec.rb b/spec/command/status_command_spec.rb
index ab4f119..4888c53 100644
--- a/spec/command/status_command_spec.rb
+++ b/spec/command/status_command_spec.rb
@@ -19,7 +19,7 @@ module Aeolus
describe StatusCommand do
it "should return status for target image" do
VCR.use_cassette('command/status_command/targetimage') do
- @options[:targetimage] = ['1a0b179b-eb8a-4ce5-96e5-2b01ef2089cb']
+ @options[:targetimage] = ['3a105ed3-20e6-410a-815d-f0ac756f2473']
s = StatusCommand.new(@options, @output)
begin
@@ -27,7 +27,7 @@ module Aeolus
rescue SystemExit => e
e.status.should == 0
end
- $stdout.string.should include("Build Status: FAILED")
+ $stdout.string.should include("Build Status: COMPLETE")
end
end
diff --git a/spec/vcr/cassettes/command/status_command/targetimage.yml
b/spec/vcr/cassettes/command/status_command/targetimage.yml
index 3e77a6d..db64b7b 100644
--- a/spec/vcr/cassettes/command/status_command/targetimage.yml
+++ b/spec/vcr/cassettes/command/status_command/targetimage.yml
@@ -2,9 +2,11 @@
- !ruby/struct:VCR::HTTPInteraction
request: !ruby/struct:VCR::Request
method: :get
- uri:
https://admin:password@localhost:443/conductor/api/provider_images/1a0b17...
+ uri:
https://admin:password@localhost:443/conductor/api/target_images/3a105ed3...
body:
headers:
+ accept-language:
+ - en
accept:
- application/xml
response: !ruby/struct:VCR::Response
@@ -15,24 +17,30 @@
x-ua-compatible:
- IE=Edge,chrome=1
etag:
- - "\"a61cb9f4c82824a7fe5c8107f167cff1\""
+ - "\"8eabd74801c9981f6c3df69dc81c19fb\""
content-type:
- application/xml; charset=utf-8
server:
- thin 1.2.11 codename Bat-Shit Crazy
date:
- - Tue, 22 Nov 2011 23:45:27 GMT
+ - Tue, 06 Dec 2011 19:21:21 GMT
x-runtime:
- - "0.049840"
+ - "0.305330"
set-cookie:
- -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlNjBhMDU4NTY2MWI2MGRjMWNlNjI2ZmY4YTFkYjQ2ODAiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--ecfe1e213920f3ba82c9b9c191118ee60d03f44c;
path=/; HttpOnly
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlOWE0MzExMDUzY2MzZmU1N2ZiYmRkMDM0NTBjOTNkNGMiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--90ff8cc38ed80b72c16d94834a139008c6928e07;
path=/; HttpOnly
cache-control:
- max-age=0, private, must-revalidate
transfer-encoding:
- chunked
body: |+
- <provider_image
href='https://localhost/conductor/api/provider_images/1a0b179b-eb8a-4ce5-96e5-2b01ef2089cb'
id='1a0b179b-eb8a-4ce5-96e5-2b01ef2089cb'>
- <status>FAILED</status>
- </provider_image>
+ <target_image
href='https://localhost/conductor/api/target_images/3a105ed3-20e6-410a-815d-f0ac756f2473'
id='3a105ed3-20e6-410a-815d-f0ac756f2473'>
+ <object_type>target_image</object_type>
+ <template>48bade4b-5b27-4b48-a9ed-a6d75ccfe02f</template>
+ <build
href='https://localhost/conductor/api/builds/8b870f9a-ac32-4e21-98fb-76b4cc24e5f1'
id='8b870f9a-ac32-4e21-98fb-76b4cc24e5f1'></build>
+ <status>COMPLETE</status>
+ <provider_images>
+ <provider_image
href='https://localhost/conductor/api/provider_images/21ba2191-be4e-44b7-8d1d-61f7f50b89c8'
id='21ba2191-be4e-44b7-8d1d-61f7f50b89c8'></provider_image>
+ </provider_images>
+ </target_image>
http_version: "1.1"
--
1.7.6.4