deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: Client: Added --user and --password parameters to Deltacloud cmd client (DTACLOUD-141)
Date Mon, 16 Apr 2012 12:52:58 GMT
Updated Branches:
  refs/heads/master 84d3c9909 -> 6499cf7fe


Client: Added --user and --password parameters to Deltacloud cmd client (DTACLOUD-141)

This change is needed because some cloud cloud providers use special
characters in API keys. Those were not properly escaped and thus handled
incorrectly by URI.parse. This caused 401 in most cases.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/6499cf7f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/6499cf7f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/6499cf7f

Branch: refs/heads/master
Commit: 6499cf7feba60ccdd26a750627b4df7d798036e6
Parents: 84d3c99
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu Apr 12 11:35:58 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Apr 12 11:35:58 2012 +0200

----------------------------------------------------------------------
 client/bin/deltacloudc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6499cf7f/client/bin/deltacloudc
----------------------------------------------------------------------
diff --git a/client/bin/deltacloudc b/client/bin/deltacloudc
index 40fabcd..a6bff13 100755
--- a/client/bin/deltacloudc
+++ b/client/bin/deltacloudc
@@ -65,6 +65,8 @@ BANNER
   opts.on( '-n', '--name NAME', 'Name (for instance eg.)') { |name| options[:name] = name
}
   opts.on( '-s', '--state STATE', 'Instance state (RUNNING, STOPPED)') { |state| options[:state]
= state }
   opts.on( '-u', '--url URL', 'API url ($API_URL variable)') { |url| options[:api_url] =
url }
+  opts.on( '-U', '--user USER', 'API username ($API_USERNAME variable)') { |u| options[:api_user]
= u }
+  opts.on( '-P', '--password PASSWORD', 'API password ($API_PASSWORD variable)') { |p| options[:api_password]
= p }
   opts.on( '-l', '--list', 'List collections/operations') { |id| options[:list] = true }
   opts.on( '-h', '--help', 'Display this screen' ) { puts @optparse; Kernel.exit! }
   opts.on( '-v', '--version', 'Display API version' ) { options[:version]=true }
@@ -104,7 +106,7 @@ options[:collection] = ARGV[0]
 options[:operation] = ARGV[1]
 
 # Connect to Deltacloud API and fetch all entry points
-client = DeltaCloud.new(url.user || ENV['API_USER'], url.password || ENV['API_PASSWORD'],
api_url)
+client = DeltaCloud.new(options[:api_user] || ENV['API_USER'], options[:api_password] ||
ENV['API_PASSWORD'], api_url)
 collections = client.entry_points.keys
 
 # Exclude collection which don't have methods in client library yet


Mime
View raw message