8 command =
'cmscond_authentication_manager --update_conn -s %s -u %s -p %s' 9 params = (serviceName, accountName, newPassword )
13 command = command %params
14 pipe = subprocess.Popen( command, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
15 stdout_val = pipe.communicate()[0]
20 parser = optparse.OptionParser(usage =
21 'Usage: %prog <file> [<file> ...]\n' 24 parser.add_option(
'-s',
'--service',
26 help =
'the service hosting the account' 29 parser.add_option(
'-a',
'--accountName',
31 help =
'the account name to change' 34 parser.add_option(
'-l',
'--label',
37 help =
'the connection label. default=accountName@service' 40 (options, arguments) = parser.parse_args()
42 if options.service ==
None or options.accountName ==
None:
46 password = getpass.getpass( prompt=
'Enter the new password:')
49 print update_credential( options.service, options.accountName, options.label, password )
50 print 'Credentials updated.' 51 except Exception
as e:
52 print 'Update credential failed: %s'%
str(e)
53 if __name__ ==
'__main__':
def update_credential(serviceName, accountName, label, newPassword)