diff --git a/requirements.txt b/requirements.txt index 7855bdf..85958c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ jsonrpclib netaddr cliff oslo.config>=1.6.0 -scapy>=2.3.1 +scapy-python3 pypcap diff --git a/steth/stethclient/clients/neutron.py b/steth/stethclient/clients/neutron.py old mode 100644 new mode 100755 index dac03b0..fe714de --- a/steth/stethclient/clients/neutron.py +++ b/steth/stethclient/clients/neutron.py @@ -24,7 +24,7 @@ try: from neutronclient.v2_0 import client from neutronclient.common import exceptions except ImportError: - print "Import neutronclient error. Please check it out." + print("Import neutronclient error. Please check it out.") sys.exit() @@ -42,10 +42,10 @@ def get_port_attr(port_id, attr): try: res = client.show_port(port_id) except exceptions.NeutronClientException: - print 'Port %s Not Found.' % port_id + print('Port %s Not Found.' % port_id) return except KeyError: - print 'Port attr: %s Not Found.' % attr + print('Port attr: %s Not Found.' % attr) return return res['port'][attr] diff --git a/steth/stethclient/constants.py b/steth/stethclient/constants.py index ed9dc78..61a3efc 100644 --- a/steth/stethclient/constants.py +++ b/steth/stethclient/constants.py @@ -93,12 +93,12 @@ def check_ip_and_fill(agent_type, net_prefix): d[name_prefix + node] = net_prefix + node agent_type.update(d) else: - print "%s is not IP!" % name_prefix + node + print("%s is not IP!" % name_prefix + node) def validate_and_parse_network_types(): if not cfg.CONF.network_types: - print 'You must fill network_types in config file!' + print("You must fill network_types in config file!") sys.exit() for network_type in cfg.CONF.network_types: net_type, net_interface, net_prefix = network_type.split(':') @@ -118,5 +118,6 @@ def validate_and_parse_network_types(): global STORAGE_INTERFACE STORAGE_INTERFACE = net_interface else: - print "Unkown network_types: %s" % network_type + print("Unkown network_types: %s" % network_type) + validate_and_parse_network_types() diff --git a/steth/stethclient/shell.py b/steth/stethclient/shell.py index db02d64..ef2c8cd 100644 --- a/steth/stethclient/shell.py +++ b/steth/stethclient/shell.py @@ -75,7 +75,7 @@ def main(argv=sys.argv[1:]): return StethShell(STETH_API_VERSION).run( map(utils.safe_decode, argv)) except KeyboardInterrupt: - print "... terminating neutron client" + print("... terminating neutron client") return 1 except Exception as e: print(e) diff --git a/steth/stethclient/utils.py b/steth/stethclient/utils.py index ccde4e5..58b763d 100644 --- a/steth/stethclient/utils.py +++ b/steth/stethclient/utils.py @@ -69,15 +69,15 @@ class Logger(): @staticmethod def log_normal(info): - print Logger.OKBLUE + info + Logger.ENDC + print(Logger.OKBLUE + info + Logger.ENDC) @staticmethod def log_high(info): - print Logger.OKGREEN + info + Logger.ENDC + print(Logger.OKGREEN + info + Logger.ENDC) @staticmethod def log_fail(info): - print Logger.FAIL + info + Logger.ENDC + print(Logger.FAIL + info + Logger.ENDC) LISTEN_PORT = 9698 @@ -134,15 +134,7 @@ def get_ip_from_agent(node, net_type): else: return 1 except Exception as e: - print "Can't get ip! Because: %s" % e - - -def generate_uuid(): - """Creates a random uuid string. - - :returns: string - """ - return str(uuid.uuid4()) + print("Can't get ip! Because: %s" % e) def _format_uuid_string(string):