[PATCH aeolus-cli] Require provider_account for image import

Matt Wagner matt.wagner at redhat.com
Tue Dec 13 19:12:19 UTC 2011


Other parameters can be inferred by Conductor.
---
 lib/aeolus_cli/command/config_parser.rb  |    9 ++++++---
 lib/aeolus_cli/command/import_command.rb |    8 +++-----
 man/aeolus-cli-import.1                  |   24 +++++++++---------------
 3 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/lib/aeolus_cli/command/config_parser.rb b/lib/aeolus_cli/command/config_parser.rb
index d0261e5..2be3e61 100644
--- a/lib/aeolus_cli/command/config_parser.rb
+++ b/lib/aeolus_cli/command/config_parser.rb
@@ -61,6 +61,9 @@ module Aeolus
           opts.on('-r', '--provider NAME1,NAME2',  Array,'name of specific provider (ie ec2-us-east1)') do |name|
             @options[:provider] = name
           end
+          opts.on('-a', '--provider_account NAME1,NAME2', Array,'name of specific provider account (ie my-ec2') do |name|
+            @options[:provider_account] = name
+          end
           opts.on('-I', '--image ID', 'ID of the base image, can be used in build and push commands, see examples') do |id|
             @options[:image] = id
           end
@@ -196,9 +199,9 @@ module Aeolus
           if !subcommand || subcommand == :import
             opts.separator ""
             opts.separator "Import examples:"
-            opts.separator "aeolus-cli import --provider ec2-us-east-1 --target ec2 --id $ami_id # import an AMI from the specified provider"
-            opts.separator "aeolus-cli import --provider ec2-us-east-1 --target ec2 --id $ami_id --description '<image><name>My Image</name></image>' # import an AMI from the specified provider"
-            opts.separator "aeolus-cli import --provider ec2-us-east-1 --target ec2 --id $ami_id --description <path_to_xml_file> # import an AMI from the specified provider"
+            opts.separator "aeolus-cli import --provider_account my-ec2 --id $ami_id # import an AMI from the specified provider"
+            opts.separator "aeolus-cli import --provider_account my-ec2 --id $ami_id --description '<image><name>My Image</name></image>' # import an AMI from the specified provider"
+            opts.separator "aeolus-cli import --provider_account my-ec2 --id $ami_id --description <path_to_xml_file> # import an AMI from the specified provider"
           end
 
           if !subcommand || subcommand == :status
diff --git a/lib/aeolus_cli/command/import_command.rb b/lib/aeolus_cli/command/import_command.rb
index a91c405..591a999 100644
--- a/lib/aeolus_cli/command/import_command.rb
+++ b/lib/aeolus_cli/command/import_command.rb
@@ -19,11 +19,10 @@ module Aeolus
         super(opts, logger)
         default = {
           :image => '',
-          :build => '',
+          :build => '', # TODO - Is this used anywhere?
           :id => '',
           :description => '<image><name>' + @options[:id] + '</name></image>',
-          :target => '',
-          :provider => ''
+          :provider_account => ''
         }
         @options = default.merge(@options)
       end
@@ -36,9 +35,8 @@ module Aeolus
           end
           # TODO: Validate Description XML
           image = Aeolus::CLI::Image.new({:target_identifier => @options[:id],
-                                          :target_name => @options[:target].first,
                                           :image_descriptor => @options[:description],
-                                          :provider_name => @options[:provider].first})
+                                          :provider_account_name => @options[:provider_account].first})
           image.save!
           puts ""
           puts "Image: " + image.id
diff --git a/man/aeolus-cli-import.1 b/man/aeolus-cli-import.1
index 6ab05ee..260d1a2 100644
--- a/man/aeolus-cli-import.1
+++ b/man/aeolus-cli-import.1
@@ -2,7 +2,7 @@
 .SH NAME
 aeolus-cli import \- command for importing existing provider images into aeolus
 .SH SYNOPSIS
-.B aeolus-cli import [\-h|--help] [\-u|--username] [\-w|--password] [\-r|--provider [provider-name]] [\--id [provider-image-id]] [--description [path-to-file|xml string]] [\T|--target [target]] [\-d|--daemon]
+.B aeolus-cli import [\-h|--help] [\-u|--username] [\-w|--password] [\-a|--provider_account [account-name]] [\--id [provider-image-id]] [--description [path-to-file|xml string]] [\-d|--daemon]
 .SH DESCRIPTION
 aeolus-cli import allows users to import pre-existing images that exist in cloud provders for example AMI from EC2, into aeolus.
 .SH OPTIONS
@@ -13,15 +13,12 @@ Conductor username
 \-w, --password <password>
 Conductor password
 .TP
-\-r, --provider <provider-name>
-The provider name as it exists in conductor from where the importing image resides
+\-a, --provider_account <account-name>
+The provider account name as it exists in Conductor from where the importing image resides
 .TP
 \--id <provider-image-id>
 The providers ID given to the importing image
 .TP
-\-T, --target
-The target type for the given provider
-.TP
 \--description <path-to-xml-description|xml string>
 A user defined description to associate with the importing image
 .TP
@@ -32,23 +29,20 @@ Get usage information for this command and associated commmands
 \-h, --help
 .SH EXAMPLES
 .TP
-Import the AMI ami-1234567 from the provider ec2-us-east-1 into aeolus
+Import the AMI ami-1234567 from the provider account my-ec2 into aeolus
 .B aeolus-cli import
-\--provider ec2-us-east-1
-\--target ec2
+\--provider_account my-ec2
 \--id ami-1234567
 .TP
-Import the AMI ami-1234567 from the provider ec2-us-west-1 into aeolus with a given xml description
+Import the AMI ami-1234567 from the provider account my-ec2 into aeolus with a given xml description
 .B aeolus-cli import
-\--provider ec2-us-west-1
-\--target ec2
+\--provider_account my-ec2
 \--id ami-1234567
 \--description '<image><name>myAMI</name></image>'
 .TP
-Import the AMI ami-1234567 from the provider ec2-us-west-1 into aeolus providing a path to the description XML file
+Import the AMI ami-1234567 from the provider account my-ec2 into aeolus providing a path to the description XML file
 .B aeolus-cli import
-\--provider ec2-us-west-1
-\--target ec23
+\--provider_account my-ec2
 \--id ami-1234567
 \--description /foo/bar/description.xml
 .SH AUTHOR
-- 
1.7.6.4




More information about the aeolus-devel mailing list