Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#402 closed enhancement (fixed)

[PATCH] Add an option to prompt for a password

Reported by: mike@… Owned by: osimons
Priority: minor Milestone: 0.6
Component: Build slave Version: dev
Keywords: Cc:
Operating System: Linux

Description

This patch makes it so the bitten slave prompts for the password, rather than taking it on the command line (and putting it in ps).

This is useful when you don't want to put your password into a config file.

Attachments (1)

0001-Add-an-option-to-prompt-for-a-password.patch (1.7 KB) - added by mike@… 15 years ago.
Patch

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by mike@…

Patch

comment:1 Changed 15 years ago by osimons

  • Owner changed from cmlenz to osimons
  • Summary changed from Add an option to prompt for a password to [PATCH] Add an option to prompt for a password

I'll look at it.

comment:2 Changed 15 years ago by osimons

Same result, but I've modified it slightly to be more rational and contained:

  • bitten/slave.py

    a b  
    358358                      help='the username to use for authentication')
    359359    parser.add_option('-p', '--password', dest='password',
    360360                      help='the password to use when authenticating')
     361    def _ask_password(option, opt_str, value, parser):
     362        from getpass import getpass
     363        parser.values.password = getpass('Passsword: ')
     364    parser.add_option('-P', '--ask-password', action='callback',
     365                      callback=_ask_password, help='Prompt for password')
    361366
    362367    group = parser.add_option_group('building')
    363368    group.add_option('-d', '--work-dir', action='store', dest='work_dir',

Any comments before I commit?

comment:3 Changed 15 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

Committed in [661]. Thanks!

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.