CMS 3D CMS Logo

Functions
update_db_credential Namespace Reference

Functions

def main ()
 
def update_credential (serviceName, accountName, newPassword)
 

Function Documentation

def update_db_credential.main ( )

Definition at line 13 of file update_db_credential.py.

References update_credential().

13 def main():
14 
15  parser = optparse.OptionParser(usage =
16  'Usage: %prog <file> [<file> ...]\n'
17  )
18 
19  parser.add_option('-s', '--service',
20  dest = 'service',
21  help = 'the service hosting the account'
22  )
23 
24  parser.add_option('-a','--accountName',
25  dest = 'accountName',
26  help = 'the account name to change'
27  )
28 
29  (options, arguments) = parser.parse_args()
30 
31  if options.service == None or options.accountName == None:
32  parser.print_help()
33  return -2
34 
35  password = getpass.getpass( prompt= 'Enter the new password:')
36 
37  try:
38  print update_credential( options.service, options.accountName, password )
39  print 'Password changed.'
40  except e:
41  print 'Update credential failed.'
def update_credential(serviceName, accountName, newPassword)
def update_db_credential.update_credential (   serviceName,
  accountName,
  newPassword 
)

Definition at line 7 of file update_db_credential.py.

Referenced by main().

7 def update_credential( serviceName, accountName, newPassword ):
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]
11  return stdout_val
12 
def update_credential(serviceName, accountName, newPassword)