# HG changeset patch # User osimons # Date 1248482243 0 # Node ID 0ac21e3343a48ad3683274976fcb0334478b7220 # Parent 246f211c132884042f8f5e13299bf0dcaa170ab6 0.6dev: Adding `-P` option to bitten-slave to prompt for password as alternative to command-line option or configuration file. Closes #402. Thanks to Mike Lundy for idea and initial patch. diff --git a/bitten/slave.py b/bitten/slave.py --- a/bitten/slave.py +++ b/bitten/slave.py @@ -358,6 +358,11 @@ help='the username to use for authentication') parser.add_option('-p', '--password', dest='password', help='the password to use when authenticating') + def _ask_password(option, opt_str, value, parser): + from getpass import getpass + parser.values.password = getpass('Passsword: ') + parser.add_option('-P', '--ask-password', action='callback', + callback=_ask_password, help='Prompt for password') group = parser.add_option_group('building') group.add_option('-d', '--work-dir', action='store', dest='work_dir',