diff --git a/RestApi/Python/exportConfig.py b/RestApi/Python/exportConfig.py index c4cb970..4eb1d91 100755 --- a/RestApi/Python/exportConfig.py +++ b/RestApi/Python/exportConfig.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 ################################################################################ # @@ -11,6 +11,9 @@ # - Updated copyright note. # - Use the ksvisionlib library. # +# July 13, 2022: +# - Change the script to Python 3. +# # Description: # This script exports the current configuration of an NTO or GSC device # to a .ata file. @@ -63,7 +66,7 @@ def exportConfig(host_ip, port, username, password, timestamp): try: opts, args = getopt.getopt(argv,"u:p:h:f:r:", ["username=", "password=", "host=", "hosts_file=", "port="]) except getopt.GetoptError: - print 'import_config.py -u -p [-h | -f ] [-r port]' + print ('import_config.py -u -p [-h | -f ] [-r port]') sys.exit(2) for opt, arg in opts: if opt in ("-u", "--username"): @@ -80,15 +83,15 @@ def exportConfig(host_ip, port, username, password, timestamp): config_file = arg if username == '': - print 'exportConfig.py -u -p [-h | -f ] [-r port]' + print ('exportConfig.py -u -p [-h | -f ] [-r port]') sys.exit(2) if password == '': - print 'exportConfig.py -u -p [-h | -f ] [-r port]' + print ('exportConfig.py -u -p [-h | -f ] [-r port]') sys.exit(2) if (host == '') and (hosts_file == ''): - print 'exportConfig.py -u -p [-h | -f ] [-r port]' + print ('exportConfig.py -u -p [-h | -f ] [-r port]') sys.exit(2) timestamp = time.strftime('%Y-%m-%d-%H-%M-%S') @@ -122,6 +125,6 @@ def exportConfig(host_ip, port, username, password, timestamp): sys.stdout.write('.') sys.stdout.flush() except KeyboardInterrupt: - print "Ctrl-c received! Sending kill to threads..." + print ("Ctrl-c received! Sending kill to threads...") sys.exit() -print "" +print ("") diff --git a/RestApi/Python/importConfig.py b/RestApi/Python/importConfig.py index 127bef1..31f29d4 100755 --- a/RestApi/Python/importConfig.py +++ b/RestApi/Python/importConfig.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 ################################################################################# # @@ -11,6 +11,9 @@ # - Updated copyright note. # - Use the ksvisionlib library. # +# July 13, 2022: +# - Change the script to Python 3. +# # Description: # This script will import a configuration (.ata) file to an NTO or an GSC # device. @@ -62,7 +65,7 @@ def importConfig(host_ip, port, username, password, config_file): try: opts, args = getopt.getopt(argv,"u:p:h:f:r:c:", ["username=", "password=", "host=", "hosts_file=", "port=", "config="]) except getopt.GetoptError: - print 'importConfig.py -u -p -c [-h | -f ] [-r port]' + print ('importConfig.py -u -p -c [-h | -f ] [-r port]') sys.exit(2) for opt, arg in opts: if opt in ("-u", "--username"): @@ -79,19 +82,19 @@ def importConfig(host_ip, port, username, password, config_file): config_file = arg if username == '': - print 'importConfig.py -u -p -c [-h | -f ] [-r port]' + print ('importConfig.py -u -p -c [-h | -f ] [-r port]') sys.exit(2) if password == '': - print 'importConfig.py -u -p -c [-h | -f ] [-r port]' + print ('importConfig.py -u -p -c [-h | -f ] [-r port]') sys.exit(2) if (host == '') and (hosts_file == ''): - print 'importConfig.py -u -p -c [-h | -f ] [-r port]' + print ('importConfig.py -u -p -c [-h | -f ] [-r port]') sys.exit(2) if config_file == '': - print 'importConfig.py -u -p -c [-h | -f ] [-r port]' + print ('importConfig.py -u -p -c [-h | -f ] [-r port]') sys.exit(2) hosts_list = [] @@ -123,6 +126,6 @@ def importConfig(host_ip, port, username, password, config_file): sys.stdout.write('.') sys.stdout.flush() except KeyboardInterrupt: - print "Ctrl-c received! Sending kill to threads..." + print ("Ctrl-c received! Sending kill to threads...") sys.exit() -print "" +print ("") diff --git a/RestApi/Python/ksvisionlib.py b/RestApi/Python/ksvisionlib.py index f822a17..508e882 100644 --- a/RestApi/Python/ksvisionlib.py +++ b/RestApi/Python/ksvisionlib.py @@ -210,6 +210,9 @@ # - No changes for v5.10.1 # - Added the getLogs method # +# July 13, 2022 +# - No changes for v5.11.0 and v5.11.1 +# # COPYRIGHT 2019-2022 Keysight Technologies. # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -3344,7 +3347,7 @@ def resetFactoryDefaultKubernetesNode(self, kubernetes_nodes_id): Reset to factory default a specific kubernetes node from the Mako card. Sample usage: """ - return self._sendRequest('POST', '/api/kubernetes_nodes/' + str(kubernetes_nodes_id) + '/reset_factory', args, False) + return self._sendRequest('POST', '/api/kubernetes_nodes/' + str(kubernetes_nodes_id) + '/reset_factory', None, False) ################################################### # Line Boards diff --git a/RestApi/Python/mkfilter.py b/RestApi/Python/mkfilter.py index 43ee1c4..dc794ab 100755 --- a/RestApi/Python/mkfilter.py +++ b/RestApi/Python/mkfilter.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 ################################################################################ # @@ -11,6 +11,9 @@ # - Updated copyright note. # - Use the ksvisionlib library. # +# July 13, 2022: +# - Change the script to Python 3. +# # Description: # This script creates 2^n filters, from 0 to 2^n-1. Where the 0th filter # contains all the source and destination IP addresses that when they are XORed @@ -98,7 +101,7 @@ def ipAddress (bits, version): try: opts, args = getopt.getopt(argv,"u:p:h:l:o:v:r:", ["username=", "password=", "host=", "length=", "offset=", "version=", "port="]) except getopt.GetoptError: - print '0mkfilters.py -u -p -h -l -o -v [-r ]' + print ('0mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) for opt, arg in opts: if opt in ("-u", "--username"): @@ -117,27 +120,27 @@ def ipAddress (bits, version): port = arg if username == '': - print '1mkfilters.py -u -p -h -l -o -v [-r ]' + print ('1mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) if password == '': - print '2mkfilters.py -u -p -h -l -o -v [-r ]' + print ('2mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) if (host == ''): - print '3mkfilters.py -u -p -h -l -o -v [-r ]' + print ('3mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) if length == '': - print '4mkfilters.py -u -p -h -l -o -v [-r ]' + print ('4mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) if offset == '': - print '5mkfilters.py -u -p -h -l -o -v [-r ]' + print ('5mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2) if version == '': - print '6mkfilters.py -u -p -h -l -o -v [-r ]' + print ('6mkfilters.py -u -p -h -l -o -v [-r ]') sys.exit(2)