4 ###############################################################################################################
7 ###############################################################################################################
12 def join_strings(lst):
15 if string is not None:
16 if type(string) == int:
18 concat += (string + " ")
22 def debug(desc, *args):
24 print desc, join_strings(args)
31 def log(desc, arg=None):
35 def error_and_exit(error_code, error_desc):
37 print "status={0}. {1}".format(error_code, '' if error_desc is None else error_desc)
39 print "status={0}".format(error_code)
43 def print_name_and_return_code(name, code):
44 print "{0:30} | {1:6}".format(name, code)
47 def print_frame_line():
48 print "----------------------------------------"
51 def parse_cmd_line_params(argv):
52 print 'Number of arguments:', len(sys.argv), 'arguments.'
60 opts, args = getopt.getopt(argv, "i:p:u:h:s:", ["ip=", "port=", "user=", "scheme="])
61 except getopt.GetoptError:
63 error_and_exit(2, 'Invalid input')
70 elif opt in ("-i", "--ip"):
72 elif opt in ("-p", "--port"):
74 elif opt in ("-u", "--user"):
76 elif opt in ("-s", "--scheme"):
79 print 'scheme =', scheme, ', be host =', be_host, ', be port =', be_port, ', user =', admin_user
84 return scheme, be_host, be_port, admin_user
89 0], '[optional -s <scheme> | --scheme=<scheme>, default http ] [-i <be host> | --ip=<be host>] [-p <be port> ' \
90 '| --port=<be port> ] [-u <user userId> | --user=<user userId> ] '