Reverted repo changes for aborted release
by steve linabery
Hi Aeolus Community!
Due to my misunderstanding of the sprint schedule, earlier today I began preparing conductor, aeolus-configure, aeolus-cli, aeolus-image-rubygem repos for another community release.
Since recent work has been primarily bugfixes, we are not doing a release at this time, but instead will roll the bugfix work into the current community release, 0.8.0. I removed the 0.9.0 branch from conductor git (as well as the respective branches I had created for -configure, -cli, and -image-rubygem).
If you have any questions about any of this, feel free to ping me (eggs) on irc or reply to this email.
Sorry for any confusion I may have caused.
Sincerely,
Steve|eggs
12 years, 3 months
[PATCH 1/3] added statistics method
by Tzu-Mainn Chen
---
src/app/models/pool_family.rb | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/app/models/pool_family.rb b/src/app/models/pool_family.rb
index 1598640..7201668 100644
--- a/src/app/models/pool_family.rb
+++ b/src/app/models/pool_family.rb
@@ -33,6 +33,8 @@
class PoolFamily < ActiveRecord::Base
include PermissionedObject
+ include ActionView::Helpers::NumberHelper
+
DEFAULT_POOL_FAMILY_KEY = "default_pool_family"
has_many :pools, :dependent => :destroy
@@ -66,4 +68,19 @@ class PoolFamily < ActiveRecord::Base
def all_providers_disabled?
!provider_accounts.empty? and !provider_accounts.any? {|acc| acc.provider.enabled?}
end
+
+ def statistics
+ used_quota = pools.collect{|p| p.statistics[:used_quota]}.sum;
+ available_quota = pools.collect{|p| p.statistics[:available_quota]}.sum;
+
+ statistics = {
+ :deployments => pools.collect{|p| p.statistics[:deployments]}.sum,
+ :total_instances => pools.collect{|p| p.statistics[:total_instances]}.sum,
+ :instances_pending => pools.collect{|p| p.statistics[:instances_pending]}.sum,
+ :instances_failed => pools.collect{|p| p.statistics[:instances_failed]}.sum,
+ :used_quota => used_quota,
+ :quota_percent => number_to_percentage(100 * used_quota / (used_quota + available_quota), :precision => 0),
+ :available_quota => available_quota,
+ }
+ end
end
--
1.7.6.5
12 years, 3 months
[PATCH conductor 0/1] Bugfix: Correct provider is displayed for imported images
by Matt Wagner
This patch fixes the bug in BZ 772352, where the lookup to find the provider account for an image would only take into account the provider type and username credential, ignoring the provider. Using the same EC2 account in multiple regions would trigger this bug.
The provider itself is now included in the query, so that we should always get the correct account back.
-- Matt
12 years, 3 months
[PATCH aeolus-cli] BZ#772006 Fixed Delete with no provider content
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
lib/aeolus_cli/command/delete_command.rb | 37 +++++++++--------
spec/command/delete_command_spec.rb | 14 +++++++
.../delete_image_no_provider_content.yml | 42 ++++++++++++++++++++
3 files changed, 75 insertions(+), 18 deletions(-)
create mode 100644 spec/vcr/cassettes/command/delete_command/delete_image_no_provider_content.yml
diff --git a/lib/aeolus_cli/command/delete_command.rb b/lib/aeolus_cli/command/delete_command.rb
index 54de83f..1fb12f2 100644
--- a/lib/aeolus_cli/command/delete_command.rb
+++ b/lib/aeolus_cli/command/delete_command.rb
@@ -78,28 +78,29 @@ module Aeolus
private
def print_provider_content(content_xml)
h = Hash.from_xml(content_xml)
- provider_content = h[h.keys.first]["content"]["provider_content"]
+ if provider_content = h[h.keys.first]["content"]["provider_content"]
content = provider_content.instance_of?(Array) ? provider_content : [provider_content]
- if content.size > 0
- widths = calculate_widths(content)
- puts "N.B. The following provider content must be manually removed"
- puts ""
-
- # Print Headers
- printf("%-#{widths[:provider] + 5}s", "Provider")
- printf("%-#{widths[:id] + 5}s", "ID")
- puts ""
+ if content.size > 0
+ widths = calculate_widths(content)
+ puts "N.B. The following provider content must be manually removed"
+ puts ""
- # Print Column Lines
- printf("%-#{widths[:provider] + 5}s", "-" * widths[:provider])
- printf("%-#{widths[:id] + 5}s", "-" * widths[:id])
- puts ""
+ # Print Headers
+ printf("%-#{widths[:provider] + 5}s", "Provider")
+ printf("%-#{widths[:id] + 5}s", "ID")
+ puts ""
- # Print Content
- content.each do |pc|
- printf("%-#{widths[:provider] + 5}s", pc["provider"])
- printf("%-#{widths[:id] + 5}s", pc["target_identifier"])
+ # Print Column Lines
+ printf("%-#{widths[:provider] + 5}s", "-" * widths[:provider])
+ printf("%-#{widths[:id] + 5}s", "-" * widths[:id])
puts ""
+
+ # Print Content
+ content.each do |pc|
+ printf("%-#{widths[:provider] + 5}s", pc["provider"])
+ printf("%-#{widths[:id] + 5}s", pc["target_identifier"])
+ puts ""
+ end
end
end
end
diff --git a/spec/command/delete_command_spec.rb b/spec/command/delete_command_spec.rb
index 7325161..6bafd1d 100644
--- a/spec/command/delete_command_spec.rb
+++ b/spec/command/delete_command_spec.rb
@@ -125,6 +125,20 @@ module Aeolus
$stdout.string.should include("Could not find ProviderImage 1234")
end
end
+
+ it "should not throw an error on delete when no provider content is found" do
+ VCR.use_cassette('command/delete_command/delete_image_no_provider_content') do
+ @options = {:image => "5f32b61f-1aad-495e-8ad7-45783ee802c5"}
+ dc = DeleteCommand.new(@options)
+ begin
+ dc.image
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ $stdout.string.should include("Image: 5f32b61f-1aad-495e-8ad7-45783ee802c5 Deleted Successfully")
+ $stdout.string.should_not include("ERROR")
+ end
+ end
end
end
end
diff --git a/spec/vcr/cassettes/command/delete_command/delete_image_no_provider_content.yml b/spec/vcr/cassettes/command/delete_command/delete_image_no_provider_content.yml
new file mode 100644
index 0000000..e099845
--- /dev/null
+++ b/spec/vcr/cassettes/command/delete_command/delete_image_no_provider_content.yml
@@ -0,0 +1,42 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :delete
+ uri: https://admin:password@localhost:443/conductor/api/images/5f32b61f-1aad-4...
+ body:
+ headers:
+ accept-language:
+ - en
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge,chrome=1
+ etag:
+ - "\"b7717357bc6e7bb39051de814ee273d4\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - thin 1.2.11 codename Bat-Shit Crazy
+ date:
+ - Fri, 06 Jan 2012 14:36:45 GMT
+ x-runtime:
+ - "0.329900"
+ set-cookie:
+ - _session_id=BAh7CCIPc2Vzc2lvbl9pZCIlZmZhMmU0N2Y5Y2ZlMmI4YzFjN2VjZDhkN2NhMmI3ZjMiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--f3390c131bb0b6f28873e1ad8d8197f8414accee; path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ transfer-encoding:
+ - chunked
+ body: |
+ <image href='https://localhost/conductor/api/images/5f32b61f-1aad-495e-8ad7-45783ee802c5' id='5f32b61f-1aad-495e-8ad7-45783ee802c5'>
+ <status>DELETED</status>
+ <content>
+ </content>
+ </image>
+
+ http_version: "1.1"
\ No newline at end of file
--
1.7.6.4
12 years, 3 months
hwp max memory value for vshpere driver
by Jan Provazník
Hi,
vshpere driver computes max memory value from effective memory (see
http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/v...),
effectiveMemory value can change in time.
Problem is that conductor fetches hw profiles only once when an account
is created and uses these cached profiles in future (IOW conductor
doesn't fetch hwprofile before each instance launch).
see https://issues.apache.org/jira/browse/DTACLOUD-123 for more details.
So I thought it would be... acceptable to compute max value in memory
range from totalMemory. I understand the argument that then this value
is incorrect too because if other instances are running, total memory
will not be available too.
Other option is to extend DC API to return additional totalMemory but
this means more changes on conductor side (difficult for 1.0 release).
Any ideas or suggestions?
Jan
12 years, 3 months
[PATCH conductor] Support for multiple accounts per provider.
by Scott Seago
This commit depends on the aeolus-image-rubygem commit:
Add provider_account-filtered 'provider images' method to build model
---
src/app/models/hardware_profile.rb | 2 +-
src/app/models/instance.rb | 10 ++-
src/app/models/provider_account.rb | 13 +---
src/spec/factories/provider_account.rb | 8 ++
src/spec/models/instance_spec.rb | 3 +-
src/spec/models/provider_account_spec.rb | 5 +-
src/spec/vcr/cassettes/iwhd_connection.yml | 143 ++++++++++++++++++++++++++++
src/spec/vcr_setup.rb | 2 +-
src/spec/vcr_setup_norec.rb | 2 +-
util/build-all | 2 +-
10 files changed, 167 insertions(+), 23 deletions(-)
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index b1eea14..6b7041c 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -230,7 +230,7 @@ class HardwareProfile < ActiveRecord::Base
match = BigDecimal.new(back_end_property.range_last.to_s) >= BigDecimal.new(front_end_property.value.to_s) ? true : false
when "enum"
create_array_from_property(back_end_property).each do |value|
- if front_end_property.value.nil? or BigDecimal.new(value) >= BigDecimal.new(front_end_property.value)
+ if front_end_property.value.nil? or BigDecimal.new(value) >= BigDecimal.new(front_end_property.value.to_s)
match = true
end
end
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index b9605cc..86a1c0f 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -188,9 +188,13 @@ class Instance < ActiveRecord::Base
image_build || (image.nil? ? nil : image.latest_pushed_build)
end
- def provider_images_for_match(provider)
- the_build = build
- (the_build ? the_build.provider_images : []).select {|pi| pi.provider_name == provider.name}
+ def provider_images_for_match(provider_account)
+ if (the_build = build)
+ the_build.provider_images_by_provider_and_account(
+ provider_account.provider.name, provider_account.warehouse_id)
+ else
+ []
+ end
end
def assembly_xml
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index c44be65..a58f473 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -65,7 +65,6 @@ class ProviderAccount < ActiveRecord::Base
validate :validate_presence_of_credentials
validate :validate_credentials
validate :validate_unique_username
- before_create :no_account?
before_destroy :destroyable?
scope :enabled, lambda { where(:provider_id => Provider.enabled) }
@@ -93,16 +92,6 @@ class ProviderAccount < ActiveRecord::Base
return true
end
- def no_account?
- #if provider.provider_accounts.empty?
- if provider.provider_accounts.empty?
- return true
- else
- errors.add(:base, "Only one account is supported per provider")
- return false
- end
- end
-
def object_list
super << provider
end
@@ -349,7 +338,7 @@ class ProviderAccount < ActiveRecord::Base
# hardware_profile that can satisfy the input hardware_profile
elsif !(hwp = HardwareProfile.match_provider_hardware_profile(provider, instance.hardware_profile))
errors << I18n.t('instances.errors.hw_profile_match_not_found', :account_name => name)
- elsif (account_images = instance.provider_images_for_match(provider)).empty?
+ elsif (account_images = instance.provider_images_for_match(self)).empty?
errors << I18n.t('instances.errors.image_not_pushed_to_provider', :account_name => name)
elsif instance.requires_config_server? and config_server.nil?
errors << I18n.t('instances.errors.no_config_server_available', :account_name => name)
diff --git a/src/spec/factories/provider_account.rb b/src/spec/factories/provider_account.rb
index b5d359a..93afc12 100644
--- a/src/spec/factories/provider_account.rb
+++ b/src/spec/factories/provider_account.rb
@@ -29,6 +29,14 @@ FactoryGirl.define do
end
end
+ factory :mock_provider_account2, :parent => :provider_account do
+ association :provider, :factory => :mock_provider2
+ after_build do |acc|
+ acc.credentials << Factory.build(:username_credential)
+ acc.credentials << Factory.build(:password_credential)
+ end
+ end
+
factory :ec2_provider_account, :parent => :provider_account do
association :provider, :factory => :ec2_provider
after_build do |acc|
diff --git a/src/spec/models/instance_spec.rb b/src/spec/models/instance_spec.rb
index 279f3e5..792c9a7 100644
--- a/src/spec/models/instance_spec.rb
+++ b/src/spec/models/instance_spec.rb
@@ -193,7 +193,8 @@ describe Instance do
end
it "shouldn't match provider accounts where image is not pushed" do
- @pool.pool_family.provider_accounts = [FactoryGirl.create(:mock_provider_account, :label => 'testaccount')]
+ account2 = FactoryGirl.create(:mock_provider_account2, :label => 'testaccount')
+ @pool.pool_family.provider_accounts = [account2]
@instance.matches.last.should include('testaccount: image is not pushed to this provider account')
end
diff --git a/src/spec/models/provider_account_spec.rb b/src/spec/models/provider_account_spec.rb
index 8b6e569..158df1d 100644
--- a/src/spec/models/provider_account_spec.rb
+++ b/src/spec/models/provider_account_spec.rb
@@ -123,7 +123,7 @@ describe ProviderAccount do
provider_account2.should be_valid
end
- it "should fail to create more than one account per provider" do
+ it "should not fail to create more than one account per provider" do
provider = FactoryGirl.create :mock_provider
acc1 = FactoryGirl.create(:mock_provider_account, :provider => provider)
acc2 = Factory.build(:mock_provider_account, :provider => provider)
@@ -131,8 +131,7 @@ describe ProviderAccount do
acc2.stub!(:validate_unique_username).and_return(true)
provider.provider_accounts << acc1
provider.provider_accounts << acc2
- acc2.save.should == false
- acc2.errors[:base].should include('Only one account is supported per provider')
+ acc2.save.should == true
end
it "should require quota to be set" do
diff --git a/src/spec/vcr/cassettes/iwhd_connection.yml b/src/spec/vcr/cassettes/iwhd_connection.yml
index 9699b25..6de6e67 100644
--- a/src/spec/vcr/cassettes/iwhd_connection.yml
+++ b/src/spec/vcr/cassettes/iwhd_connection.yml
@@ -2163,6 +2163,96 @@
- !ruby/struct:VCR::HTTPInteraction
request: !ruby/struct:VCR::Request
method: :post
+ uri: http://localhost:9090/target_images/_query
+ body: ($build == "63838705-8608-44c6-aded-7c243137172c")
+ headers:
+ accept:
+ - "*/*; q=0.5, application/xml"
+ accept-encoding:
+ - gzip, deflate
+ content-length:
+ - "50"
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ date:
+ - Wed, 14 Dec 2011 11:45:15 GMT
+ transfer-encoding:
+ - chunked
+ body: |
+ <objects>
+ <object>
+ <bucket>target_images</bucket>
+ <key>1a955a06-ca92-4546-9121-6c35e162f67b</key>
+ </object>
+ </objects>
+
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: http://localhost:9090/provider_images/_query
+ body: ($target_image == "1a955a06-ca92-4546-9121-6c35e162f67b")
+ headers:
+ accept:
+ - "*/*; q=0.5, application/xml"
+ accept-encoding:
+ - gzip, deflate
+ content-length:
+ - "57"
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ date:
+ - Wed, 14 Dec 2011 11:45:28 GMT
+ transfer-encoding:
+ - chunked
+ body: |
+ <objects>
+ <object>
+ <bucket>provider_images</bucket>
+ <key>aa57b1ab-f565-4a7a-b054-58ef5af1a053</key>
+ </object>
+ </objects>
+
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: http://localhost:9090/provider_images/_query
+ body: ($target_image == "1a955a06-ca92-4546-9121-6c35e162f67b" && $provider == "mock")
+ headers:
+ accept:
+ - "*/*; q=0.5, application/xml"
+ accept-encoding:
+ - gzip, deflate
+ content-length:
+ - "80"
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ date:
+ - Wed, 14 Dec 2011 11:45:28 GMT
+ transfer-encoding:
+ - chunked
+ body: |
+ <objects>
+ <object>
+ <bucket>provider_images</bucket>
+ <key>aa57b1ab-f565-4a7a-b054-58ef5af1a053</key>
+ </object>
+ </objects>
+
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
uri: http://localhost:9090/provider_images/_query
body: ($target_image == "ce1c6d32-5e26-4feb-9b86-83435a39b1f0")
headers:
@@ -2192,6 +2282,59 @@
http_version: "1.1"
- !ruby/struct:VCR::HTTPInteraction
request: !ruby/struct:VCR::Request
+ method: :post
+ uri: http://localhost:9090/provider_images/_query
+ body: ($target_image == "ce1c6d32-5e26-4feb-9b86-83435a39b1f0" && $provider == "mock")
+ headers:
+ accept:
+ - "*/*; q=0.5, application/xml"
+ accept-encoding:
+ - gzip, deflate
+ content-length:
+ - "80"
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ date:
+ - Wed, 14 Dec 2011 11:45:28 GMT
+ transfer-encoding:
+ - chunked
+ body: |
+ <objects>
+ <object>
+ <bucket>provider_images</bucket>
+ <key>aa57b1ab-f565-4a7a-b054-58ef5af1a053</key>
+ </object>
+ </objects>
+
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :post
+ uri: http://localhost:9090/provider_images/_query
+ body: ($target_image == "ce1c6d32-5e26-4feb-9b86-83435a39b1f0" && $provider == "mock2")
+ headers:
+ accept:
+ - "*/*; q=0.5, application/xml"
+ accept-encoding:
+ - gzip, deflate
+ content-length:
+ - "81"
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 404
+ message: Not Found
+ headers:
+ date:
+ - Wed, 14 Dec 2011 13:53:22 GMT
+ content-length:
+ - "0"
+ body:
+ http_version: "1.1"
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
method: :get
uri: http://localhost:9090/images/53d2a281-448b-4872-b1b0-680edaad5922
body:
diff --git a/src/spec/vcr_setup.rb b/src/spec/vcr_setup.rb
index 49cbe64..bd38120 100644
--- a/src/spec/vcr_setup.rb
+++ b/src/spec/vcr_setup.rb
@@ -33,7 +33,7 @@ Aeolus::Image::Warehouse::Connection.class_eval do
opts[:plain] ||= false
opts[:headers] ||= {}
result=nil
- VCR.use_cassette('iwhd_connection', :record => :new_episodes) do
+ VCR.use_cassette('iwhd_connection', :record => :new_episodes, :match_requests_on => [:method, :uri, :body]) do
result = RestClient::Request.execute :method => opts[:method], :url => @uri + path, :payload => opts[:content], :headers => opts[:headers]
end
diff --git a/src/spec/vcr_setup_norec.rb b/src/spec/vcr_setup_norec.rb
index 6dcd2e9..506cf71 100644
--- a/src/spec/vcr_setup_norec.rb
+++ b/src/spec/vcr_setup_norec.rb
@@ -52,4 +52,4 @@ VCR.config do |c|
c.allow_http_connections_when_no_cassette = true
end
-VCR::Cassette.new(File.basename(file.path, '.yml'), :record => :none)
+VCR::Cassette.new(File.basename(file.path, '.yml'), :record => :none, :match_requests_on => [:method, :uri, :body])
diff --git a/util/build-all b/util/build-all
index d230125..c0eaaf0 100755
--- a/util/build-all
+++ b/util/build-all
@@ -10,7 +10,7 @@ cd ../aeolus-configure
rake rpms
cd ../aeolus-image-rubygem
rake rpms
-cd ../aeolus-image
+cd ../aeolus-cli
rake rpms
sudo yum --nogpgcheck -y install ~/rpmbuild/RPMS/noarch/rubygem-* \
~/rpmbuild/RPMS/noarch/aeolus-* --enablerepo=fedora-aeolus-testing
--
1.7.6.4
12 years, 3 months
[PATCH conductor] API - Added template checking when creating an image
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=761139
If template is invalid, imagefactory returns general 'internal server error',
so a user doesn't know why the build failed. This patch adds template validation
(it's also used in UI)
---
src/app/controllers/api/images_controller.rb | 3 +++
src/config/locales/en.yml | 1 +
src/spec/controllers/api/images_controller_spec.rb | 15 ++++++++++++++-
3 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/src/app/controllers/api/images_controller.rb b/src/app/controllers/api/images_controller.rb
index 18d0908..74c875b 100644
--- a/src/app/controllers/api/images_controller.rb
+++ b/src/app/controllers/api/images_controller.rb
@@ -49,6 +49,9 @@ module Api
if req[:type] == :failed
raise(Aeolus::Conductor::API::InsufficientParametersSupplied.new(400, t("api.error_messages.specify_a_type_build_or_import")))
elsif req[:type] == :build
+ errors = TemplateXML.validate(req[:params][:template])
+ raise Aeolus::Conductor::API::ParameterDataIncorrect.new(400, t("api.error_messages.invalid_template", :errors => errors.join(", "))) if errors.any?
+
@targetnotfound=false
@badtarget=""
req[:params][:targets].split(",").each do |t|
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index c77e229..50f5b6f 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -1196,6 +1196,7 @@ en:
image_not_found_on_provider: "Could not find Image %{image} on provider"
in_grabbing_target_images: "In grabbing list of target images: %{error}"
invalid_parameters_for_account_and_target_image: "Invalid parameters for Account: %{account} TargetImage: %{targetimage}"
+ invalid_template: "Invalid template: %{errors}"
no_image_build_or_target_image: "Invalid Parameters: No Image, Build or TargetImage provided in request"
no_matching_target_image: Could not find any matching Target Images
no_provider_account_given: No provider account given
diff --git a/src/spec/controllers/api/images_controller_spec.rb b/src/spec/controllers/api/images_controller_spec.rb
index d3fb24f..67ddf15 100644
--- a/src/spec/controllers/api/images_controller_spec.rb
+++ b/src/spec/controllers/api/images_controller_spec.rb
@@ -211,11 +211,24 @@ describe Api::ImagesController do
context "when trying to build image" do
before(:each) do
+ tpl =%q{<template>
+ <name>Fedora 15 Template</name>
+ <os>
+ <name>Fedora</name>
+ <version>15</version>
+ <arch>x86_64</arch>
+ <install type='url'>
+ <url>http://download.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/x86...</url>
+ </install>
+ <rootpw>p@ssw0rd</rootpw>
+ </os>
+ <description>A Fedora 15 Image Factory Template</description>
+ </template>}
xml = Nokogiri::XML::Builder.new do
image {
targets "mock"
tdl {
- template "templ"
+ parent.add_child(Nokogiri::XML(tpl).root)
target "mock"
}
}
--
1.7.6
12 years, 3 months
[PATCH aeolus-cli] Updated man to reflect import changes
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
man/aeolus-image-import.1 | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/man/aeolus-image-import.1 b/man/aeolus-image-import.1
index 069f55d..c8d7742 100644
--- a/man/aeolus-image-import.1
+++ b/man/aeolus-image-import.1
@@ -2,7 +2,7 @@
.SH NAME
aeolus-image import \- command for importing existing provider images into aeolus
.SH SYNOPSIS
-.B aeolus-image import [\-h|--help] [\-u|--username] [\-w|--password] [\-a|--provider_account [account-name]] [\--id [provider-image-id]] [--description [path-to-file|xml string]] [\-d|--daemon]
+.B aeolus-image import [\-h|--help] [\-u|--username] [\-w|--password] [\-A|--account [account-name]] [\--id [provider-image-id]] [--description [path-to-file|xml string]] [\-d|--daemon]
.SH DESCRIPTION
aeolus-image import allows users to import pre-existing images that exist in cloud provders for example AMI from EC2, into aeolus.
.SH OPTIONS
@@ -13,7 +13,7 @@ Conductor username
\-w, --password <password>
Conductor password
.TP
-\-a, --provider_account <account-name>
+\-A, --_account <account-name>
The provider account name as it exists in Conductor from where the importing image resides
.TP
\--id <provider-image-id>
@@ -31,18 +31,18 @@ Get usage information for this command and associated commmands
.TP
Import the AMI ami-1234567 from the provider account my-ec2 into aeolus
.B aeolus-image import
-\--provider_account my-ec2
+\--account my-ec2
\--id ami-1234567
.TP
Import the AMI ami-1234567 from the provider account my-ec2 into aeolus with a given xml description
.B aeolus-image import
-\--provider_account my-ec2
+\--account my-ec2
\--id ami-1234567
\--description '<image><name>myAMI</name></image>'
.TP
Import the AMI ami-1234567 from the provider account my-ec2 into aeolus providing a path to the description XML file
.B aeolus-image import
-\--provider_account my-ec2
+\--account my-ec2
\--id ami-1234567
\--description /foo/bar/description.xml
.SH AUTHOR
--
1.7.6.4
12 years, 3 months
[PATCH aeolus-cli] BZ#771793 Updated Import Output to list format
by Martyn Taylor
From: Martyn Taylor <mtaylor(a)redhat.com>
---
lib/aeolus_cli/command/import_command.rb | 21 ++++++++++----
spec/command/import_command_spec.rb | 45 ++++++++++++++++++++++--------
2 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/lib/aeolus_cli/command/import_command.rb b/lib/aeolus_cli/command/import_command.rb
index dcce188..c53d749 100644
--- a/lib/aeolus_cli/command/import_command.rb
+++ b/lib/aeolus_cli/command/import_command.rb
@@ -36,12 +36,21 @@ module Aeolus
:image_descriptor => @options[:description],
:provider_account_name => @options[:provider_account].first})
image.save!
- puts ""
- puts "Image: " + image.id
- puts "Build: " + image.build.id
- puts "Target Image: " + image.build.target_images.target_image.id
- puts "Provider Image: " + image.build.target_images.target_image.provider_images.provider_image.id
- puts "Status: " + image.build.target_images.target_image.provider_images.provider_image.status
+
+ headers = ActiveSupport::OrderedHash.new
+ headers[:image] = "Image"
+ headers[:build] = "Build"
+ headers[:target_image] = "Target Image"
+ headers[:id] = "Provider Image"
+ headers[:status] = "Status"
+
+ pi = image.build.target_images.target_image.provider_images.provider_image
+ pi.image = image.id
+ pi.build = image.build.id
+ pi.target_image = image.build.target_images.target_image.id
+ pi_array = Array(pi)
+
+ print_collection(pi_array, headers)
quit(0)
rescue => e
handle_exception(e)
diff --git a/spec/command/import_command_spec.rb b/spec/command/import_command_spec.rb
index 3a498ef..a221b4e 100644
--- a/spec/command/import_command_spec.rb
+++ b/spec/command/import_command_spec.rb
@@ -35,10 +35,17 @@ module Aeolus
rescue SystemExit => e
e.status.should == 0
end
- $stdout.string.should include("Image:")
- $stdout.string.should include("Target Image:")
- $stdout.string.should include("Build:")
- $stdout.string.should include("Provider Image:")
+ $stdout.string.should include("Image")
+ $stdout.string.should include("Target Image")
+ $stdout.string.should include("Build")
+ $stdout.string.should include("Provider Image")
+ $stdout.string.should include("Status")
+
+ $stdout.string.should include("ddc15456-6fe3-4947-abdd-b198e0f3362d")
+ $stdout.string.should include("07553e18-ad7e-455e-aa18-b6d2c1c810b2")
+ $stdout.string.should include("c65d1b8a-5484-47ce-915e-fe57897eb1f1")
+ $stdout.string.should include("19c08854-9b3b-4abd-b19c-3d0f98a7d105")
+ $stdout.string.should include("COMPLETE")
end
end
end
@@ -54,10 +61,17 @@ module Aeolus
rescue SystemExit => e
e.status.should == 0
end
- $stdout.string.should include("Image:")
- $stdout.string.should include("Target Image:")
- $stdout.string.should include("Build:")
- $stdout.string.should include("Provider Image:")
+ $stdout.string.should include("Image")
+ $stdout.string.should include("Target Image")
+ $stdout.string.should include("Build")
+ $stdout.string.should include("Provider Image")
+ $stdout.string.should include("Status")
+
+ $stdout.string.should include("ddc15456-6fe3-4947-abdd-b198e0f3362d")
+ $stdout.string.should include("07553e18-ad7e-455e-aa18-b6d2c1c810b2")
+ $stdout.string.should include("c65d1b8a-5484-47ce-915e-fe57897eb1f1")
+ $stdout.string.should include("19c08854-9b3b-4abd-b19c-3d0f98a7d105")
+ $stdout.string.should include("COMPLETE")
end
end
end
@@ -91,10 +105,17 @@ module Aeolus
rescue SystemExit => e
e.status.should == 0
end
- $stdout.string.should include("Image:")
- $stdout.string.should include("Target Image:")
- $stdout.string.should include("Build:")
- $stdout.string.should include("Provider Image:")
+ $stdout.string.should include("Image")
+ $stdout.string.should include("Target Image")
+ $stdout.string.should include("Build")
+ $stdout.string.should include("Provider Image")
+ $stdout.string.should include("Status")
+
+ $stdout.string.should include("510bec08-e6fa-4004-aa21-c726b420d97e")
+ $stdout.string.should include("24c0f87e-86f6-4bd3-a3a6-a61d89b348f6")
+ $stdout.string.should include("e6841cdc-c632-4dc8-be5e-8da8476b02cc")
+ $stdout.string.should include("e21fe1a3-4c14-473a-8818-9aeeac09c8ad")
+ $stdout.string.should include("COMPLETE")
end
end
--
1.7.6.4
12 years, 3 months