def change_password(username, password, uid=None):
 if (uid is None):
  user = list_users()
  uid = user[username]['index']
 if uid:
  return __execute_cmd('config -g cfgUserAdmin -o                 cfgUserAdminPassword -i {0} {1}'.format(uid, password))
 else:
  log.warning("'{0}' does not exist".format(username))
  return False
 return True

def change_password ( username , password , uid = None ) : if ( uid is None ) : user = list_users ( ) uid = user [ username ] [ 'index' ] if uid : return __execute_cmd ( 'config -g cfgUserAdmin -o                 cfgUserAdminPassword -i {0} {1}' . format ( uid , password ) ) else : log . warning ( "'{0}' does not exist" . format ( username ) ) return False return True
view function which handles a change password request .