8 command =
'cmscond_authentication_manager --update_conn -s %s -u %s -p %s' %(serviceName, accountName, newPassword )
9 pipe = subprocess.Popen( command, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
10 stdout_val = pipe.communicate()[0]
15 parser = optparse.OptionParser(usage =
16 'Usage: %prog <file> [<file> ...]\n' 19 parser.add_option(
'-s',
'--service',
21 help =
'the service hosting the account' 24 parser.add_option(
'-a',
'--accountName',
26 help =
'the account name to change' 29 (options, arguments) = parser.parse_args()
31 if options.service ==
None or options.accountName ==
None:
35 password = getpass.getpass( prompt=
'Enter the new password:')
39 print 'Password changed.' 41 print 'Update credential failed.' 42 if __name__ ==
'__main__':
def update_credential(serviceName, accountName, newPassword)