[pkg-eucalyptus-commits] [euca2ools] 20/41: Ask for passwords twice in interactive prompts

Charles Plessy plessy at alioth.debian.org
Sat Oct 12 03:24:17 UTC 2013


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch master
in repository euca2ools.

commit 2af1d52ab1766248f12971bafd082198148247ff
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Tue Aug 20 15:30:06 2013 -0700

    Ask for passwords twice in interactive prompts
    
    Fixes TOOLS-362
---
 euca2ools/commands/euare/createloginprofile.py |    7 ++++++-
 euca2ools/commands/euare/updateloginprofile.py |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/euca2ools/commands/euare/createloginprofile.py b/euca2ools/commands/euare/createloginprofile.py
index 4a8eed5..a0ed7bd 100644
--- a/euca2ools/commands/euare/createloginprofile.py
+++ b/euca2ools/commands/euare/createloginprofile.py
@@ -42,4 +42,9 @@ class CreateLoginProfile(EuareRequest):
         EuareRequest.configure(self)
         if self.args['Password'] is None:
             self.log.info('no password supplied; prompting')
-            self.params['Password'] = getpass.getpass()
+            pass1 = '1'
+            pass2 = '2'
+            while pass1 != pass2:
+                pass1 = getpass.getpass(prompt='New password: ')
+                pass2 = getpass.getpass(prompt='Retype new password: ')
+            self.params['Password'] = pass1
diff --git a/euca2ools/commands/euare/updateloginprofile.py b/euca2ools/commands/euare/updateloginprofile.py
index 8692477..10bd6c6 100644
--- a/euca2ools/commands/euare/updateloginprofile.py
+++ b/euca2ools/commands/euare/updateloginprofile.py
@@ -42,4 +42,9 @@ class UpdateLoginProfile(EuareRequest):
         EuareRequest.configure(self)
         if self.args['Password'] is None:
             self.log.info('no password supplied; prompting')
-            self.params['Password'] = getpass.getpass()
+            pass1 = '1'
+            pass2 = '2'
+            while pass1 != pass2:
+                pass1 = getpass.getpass(prompt='New password: ')
+                pass2 = getpass.getpass(prompt='Retype new password: ')
+            self.params['Password'] = pass1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-eucalyptus/euca2ools.git



More information about the pkg-eucalyptus-commits mailing list