Renaming ipadress - ip_address
Bugfix user table Result testrun Updated cn translation
This commit is contained in:
24
cps/cli.py
24
cps/cli.py
@@ -71,7 +71,7 @@ if args.c:
|
||||
if os.path.isfile(args.c):
|
||||
certfilepath = args.c
|
||||
else:
|
||||
print("Certfilepath is invalid. Exiting...")
|
||||
print("Certfile path is invalid. Exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
if args.c == "":
|
||||
@@ -81,7 +81,7 @@ if args.k:
|
||||
if os.path.isfile(args.k):
|
||||
keyfilepath = args.k
|
||||
else:
|
||||
print("Keyfilepath is invalid. Exiting...")
|
||||
print("Keyfile path is invalid. Exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
if (args.k and not args.c) or (not args.k and args.c):
|
||||
@@ -91,29 +91,29 @@ if (args.k and not args.c) or (not args.k and args.c):
|
||||
if args.k == "":
|
||||
keyfilepath = ""
|
||||
|
||||
# handle and check ipadress argument
|
||||
ipadress = args.i or None
|
||||
if ipadress:
|
||||
# handle and check ip address argument
|
||||
ip_address = args.i or None
|
||||
if ip_address:
|
||||
try:
|
||||
# try to parse the given ip address with socket
|
||||
if hasattr(socket, 'inet_pton'):
|
||||
if ':' in ipadress:
|
||||
socket.inet_pton(socket.AF_INET6, ipadress)
|
||||
if ':' in ip_address:
|
||||
socket.inet_pton(socket.AF_INET6, ip_address)
|
||||
else:
|
||||
socket.inet_pton(socket.AF_INET, ipadress)
|
||||
socket.inet_pton(socket.AF_INET, ip_address)
|
||||
else:
|
||||
# on windows python < 3.4, inet_pton is not available
|
||||
# inet_atom only handles IPv4 addresses
|
||||
socket.inet_aton(ipadress)
|
||||
socket.inet_aton(ip_address)
|
||||
except socket.error as err:
|
||||
print(ipadress, ':', err)
|
||||
print(ip_address, ':', err)
|
||||
sys.exit(1)
|
||||
|
||||
# handle and check user password argument
|
||||
user_credentials = args.s or None
|
||||
if user_credentials and ":" not in user_credentials:
|
||||
print("No valid username:password format")
|
||||
print("No valid 'username:password' format")
|
||||
sys.exit(3)
|
||||
|
||||
# Handles enableing of filepicker
|
||||
# Handles enabling of filepicker
|
||||
filepicker = args.f or None
|
||||
|
||||
Reference in New Issue
Block a user