Fix gate failure

Bumped a bunch of constraints and requirements to fix
a gate failure with recent pip update.
Fix associated new warnings.

Change-Id: Ibc6f6025b89f2ac893471bf58794569804545b9d
This commit is contained in:
Flavio Fernandes 2020-12-18 16:19:45 -05:00
parent e36f3270e6
commit 0968b410ce
16 changed files with 181 additions and 178 deletions

View File

@ -1,15 +1,17 @@
alabaster==0.7.10 alabaster==0.7.10
appdirs==1.4.3 appdirs==1.4.3
astroid==1.3.8 astroid==2.4.0
Babel==2.3.4 Babel==2.3.4
cliff==2.8.0
cmd2==0.8.0
coverage==4.0 coverage==4.0
docutils==0.11 docutils==0.11
dulwich==0.15.0 dulwich==0.15.0
extras==1.0.0 extras==1.0.0
fixtures==3.0.0 fixtures==3.0.0
flake8==2.5.5 flake8==3.7.9
future==0.16.0 future==0.16.0
hacking==0.12.0 hacking==3.0.1
imagesize==0.7.1 imagesize==0.7.1
iso8601==0.1.11 iso8601==0.1.11
isort==4.3.21 isort==4.3.21
@ -18,7 +20,7 @@ keystoneauth1==3.4.0
linecache2==1.0.0 linecache2==1.0.0
logilab-common==1.4.1 logilab-common==1.4.1
MarkupSafe==1.0 MarkupSafe==1.0
mccabe==0.2.1 mccabe==0.6.1
mox3==0.20.0 mox3==0.20.0
netaddr==0.7.18 netaddr==0.7.18
os-client-config==1.28.0 os-client-config==1.28.0
@ -27,16 +29,16 @@ oslotest==3.2.0
ovs==2.10.0 ovs==2.10.0
pbr==2.0.0 pbr==2.0.0
pep8==1.5.7 pep8==1.5.7
pyflakes==0.8.1 pyflakes==2.1.1
Pygments==2.2.0 Pygments==2.2.0
pylint==1.9.2 pylint==2.6.0
python-mimeparse==1.6.0 python-mimeparse==1.6.0
python-subunit==1.0.0 python-subunit==1.0.0
pytz==2013.6 pytz==2013.6
PyYAML==3.12 PyYAML==5.3.1
requests==2.14.2 requests==2.14.2
requestsexceptions==1.2.0 requestsexceptions==1.2.0
six==1.10.0 six==1.12.0
snowballstemmer==1.2.1 snowballstemmer==1.2.1
stevedore==1.20.0 stevedore==1.20.0
stestr==2.0.0 stestr==2.0.0

View File

@ -27,7 +27,7 @@ class Backend(object):
_ovsdb_connection = None _ovsdb_connection = None
def __init__(self, connection, start=True, auto_index=True, **kwargs): def __init__(self, connection, start=True, auto_index=True, **kwargs):
super(Backend, self).__init__(**kwargs) super().__init__(**kwargs)
self.ovsdb_connection = connection self.ovsdb_connection = connection
if auto_index: if auto_index:
if connection.is_running: if connection.is_running:
@ -111,7 +111,7 @@ class Backend(object):
connection_exception = exceptions.OvsdbConnectionUnavailable( connection_exception = exceptions.OvsdbConnectionUnavailable(
db_schema=self.schema, error=e) db_schema=self.schema, error=e)
LOG.exception(connection_exception) LOG.exception(connection_exception)
raise connection_exception raise connection_exception from e
def restart_connection(self): def restart_connection(self):
self.ovsdb_connection.stop() self.ovsdb_connection.stop()
@ -194,7 +194,7 @@ class Backend(object):
return t.rows[record] return t.rows[record]
except KeyError: except KeyError:
raise idlutils.RowNotFound(table=table, col='uuid', raise idlutils.RowNotFound(table=table, col='uuid',
match=record) match=record) from None
try: try:
uuid_ = uuid.UUID(record) uuid_ = uuid.UUID(record)
return t.rows[uuid_] return t.rows[uuid_]

View File

@ -96,7 +96,7 @@ class AddCommand(BaseCommand):
class DbCreateCommand(BaseCommand): class DbCreateCommand(BaseCommand):
def __init__(self, api, table, _as_row=False, **columns): def __init__(self, api, table, _as_row=False, **columns):
super(DbCreateCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.columns = columns self.columns = columns
self.row = _as_row self.row = _as_row
@ -118,7 +118,7 @@ class DbCreateCommand(BaseCommand):
class DbDestroyCommand(BaseCommand): class DbDestroyCommand(BaseCommand):
def __init__(self, api, table, record): def __init__(self, api, table, record):
super(DbDestroyCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
@ -129,7 +129,7 @@ class DbDestroyCommand(BaseCommand):
class DbSetCommand(BaseCommand): class DbSetCommand(BaseCommand):
def __init__(self, api, table, record, *col_values): def __init__(self, api, table, record, *col_values):
super(DbSetCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
self.col_values = col_values self.col_values = col_values
@ -161,7 +161,7 @@ class DbSetCommand(BaseCommand):
class DbAddCommand(BaseCommand): class DbAddCommand(BaseCommand):
def __init__(self, api, table, record, column, *values): def __init__(self, api, table, record, column, *values):
super(DbAddCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
self.column = column self.column = column
@ -195,7 +195,7 @@ class DbAddCommand(BaseCommand):
class DbClearCommand(BaseCommand): class DbClearCommand(BaseCommand):
def __init__(self, api, table, record, column): def __init__(self, api, table, record, column):
super(DbClearCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
self.column = column self.column = column
@ -209,7 +209,7 @@ class DbClearCommand(BaseCommand):
class DbGetCommand(ReadOnlyCommand): class DbGetCommand(ReadOnlyCommand):
def __init__(self, api, table, record, column): def __init__(self, api, table, record, column):
super(DbGetCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
self.column = column self.column = column
@ -229,7 +229,7 @@ class DbGetCommand(ReadOnlyCommand):
class DbListCommand(ReadOnlyCommand): class DbListCommand(ReadOnlyCommand):
def __init__(self, api, table, records, columns, if_exists, row=False): def __init__(self, api, table, records, columns, if_exists, row=False):
super(DbListCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.columns = columns self.columns = columns
self.if_exists = if_exists self.if_exists = if_exists
@ -299,7 +299,7 @@ class DbListCommand(ReadOnlyCommand):
class DbFindCommand(ReadOnlyCommand): class DbFindCommand(ReadOnlyCommand):
def __init__(self, api, table, *conditions, **kwargs): def __init__(self, api, table, *conditions, **kwargs):
super(DbFindCommand, self).__init__(api) super().__init__(api)
self.table = self.api._tables[table] self.table = self.api._tables[table]
self.conditions = conditions self.conditions = conditions
self.row = kwargs.get('row', False) self.row = kwargs.get('row', False)
@ -321,7 +321,7 @@ class DbFindCommand(ReadOnlyCommand):
class BaseGetRowCommand(ReadOnlyCommand): class BaseGetRowCommand(ReadOnlyCommand):
def __init__(self, api, record): def __init__(self, api, record):
super(BaseGetRowCommand, self).__init__(api) super().__init__(api)
self.record = record self.record = record
def run_idl(self, txn): def run_idl(self, txn):
@ -330,7 +330,7 @@ class BaseGetRowCommand(ReadOnlyCommand):
class DbRemoveCommand(BaseCommand): class DbRemoveCommand(BaseCommand):
def __init__(self, api, table, record, column, *values, **keyvalues): def __init__(self, api, table, record, column, *values, **keyvalues):
super(DbRemoveCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.record = record self.record = record
self.column = column self.column = column

View File

@ -36,20 +36,20 @@ LOG = logging.getLogger(__name__)
class TransactionQueue(queue.Queue, object): class TransactionQueue(queue.Queue, object):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(TransactionQueue, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self._wait_queue = connection_utils.WaitQueue( self._wait_queue = connection_utils.WaitQueue(
max_queue_size=self.maxsize) max_queue_size=self.maxsize)
def get_nowait(self, *args, **kwargs): def get_nowait(self, *args, **kwargs):
try: try:
result = super(TransactionQueue, self).get_nowait(*args, **kwargs) result = super().get_nowait(*args, **kwargs)
except queue.Empty: except queue.Empty:
return None return None
self._wait_queue.alert_notification_consume() self._wait_queue.alert_notification_consume()
return result return result
def put(self, *args, **kwargs): def put(self, *args, **kwargs):
super(TransactionQueue, self).put(*args, **kwargs) super().put(*args, **kwargs)
self._wait_queue.alert_notify() self._wait_queue.alert_notify()
@property @property
@ -149,10 +149,10 @@ class Connection(object):
# run when we are started # run when we are started
try: try:
self.txns.put(txn, timeout=self.timeout) self.txns.put(txn, timeout=self.timeout)
except queue.Full: except queue.Full as e:
raise exceptions.TimeoutException(commands=txn.commands, raise exceptions.TimeoutException(commands=txn.commands,
timeout=self.timeout, timeout=self.timeout,
cause='TXN queue is full') cause='TXN queue is full') from e
class OvsdbIdl(idl.Idl): class OvsdbIdl(idl.Idl):

View File

@ -52,4 +52,4 @@ class WaitEvent(RowEvent, ovsdb_event.WaitEvent):
class RowEventHandler(ovsdb_event.RowEventHandler): class RowEventHandler(ovsdb_event.RowEventHandler):
def notify(self, event, row, updates=None): def notify(self, event, row, updates=None):
row = idlutils.frozen_row(row) row = idlutils.frozen_row(row)
super(RowEventHandler, self).notify(event, row, updates) super().notify(event, row, updates)

View File

@ -124,7 +124,7 @@ def row_by_record(idl_, table, record):
except ValueError: except ValueError:
# Not a UUID string, continue lookup by other means # Not a UUID string, continue lookup by other means
pass pass
except KeyError: except KeyError as e:
if sys.platform != 'win32': if sys.platform != 'win32':
# On Windows the name of the ports is described by the OVS schema: # On Windows the name of the ports is described by the OVS schema:
# https://tinyurl.com/zk8skhx # https://tinyurl.com/zk8skhx
@ -134,7 +134,7 @@ def row_by_record(idl_, table, record):
# as it happens on Linux and will try to fetch the directly # as it happens on Linux and will try to fetch the directly
# the column instead of using the lookup table. This will raise # the column instead of using the lookup table. This will raise
# a KeyError exception on Windows. # a KeyError exception on Windows.
raise RowNotFound(table=table, col='uuid', match=record) raise RowNotFound(table=table, col='uuid', match=record) from e
rl = _LOOKUP_TABLE.get(table, RowLookup(table, get_index_column(t), None)) rl = _LOOKUP_TABLE.get(table, RowLookup(table, get_index_column(t), None))
# no table means uuid only, no column means lookup table only has one row # no table means uuid only, no column means lookup table only has one row
@ -195,7 +195,7 @@ def get_schema_helper(connection, schema_name):
"%(err)s", {'conn': c, "%(err)s", {'conn': c,
'err': os.strerror(err)}) 'err': os.strerror(err)})
continue continue
elif resp.error: if resp.error:
LOG.error("TRXN error, failed to retrieve schema from %(conn)s: " LOG.error("TRXN error, failed to retrieve schema from %(conn)s: "
"%(err)s", {'conn': c, "%(err)s", {'conn': c,
'err': resp.error}) 'err': resp.error})

View File

@ -52,10 +52,11 @@ class Transaction(api.Transaction):
self.ovsdb_connection.queue_txn(self) self.ovsdb_connection.queue_txn(self)
try: try:
result = self.results.get(timeout=self.timeout) result = self.results.get(timeout=self.timeout)
except queue.Empty: except queue.Empty as e:
raise exceptions.TimeoutException(commands=self.commands, raise exceptions.TimeoutException(
timeout=self.timeout, commands=self.commands,
cause='Result queue is empty') timeout=self.timeout,
cause='Result queue is empty') from e
if isinstance(result, idlutils.ExceptionResult): if isinstance(result, idlutils.ExceptionResult):
if self.log_errors: if self.log_errors:
LOG.error(result.tb) LOG.error(result.tb)
@ -103,7 +104,7 @@ class Transaction(api.Transaction):
# idl.run() again. So, call idl.run() here just in case. # idl.run() again. So, call idl.run() here just in case.
self.api.idl.run() self.api.idl.run()
continue continue
elif status in (txn.ERROR, txn.NOT_LOCKED): if status in (txn.ERROR, txn.NOT_LOCKED):
msg = 'OVSDB Error: ' msg = 'OVSDB Error: '
if status == txn.NOT_LOCKED: if status == txn.NOT_LOCKED:
msg += ("The transaction failed because the IDL has " msg += ("The transaction failed because the IDL has "
@ -118,10 +119,10 @@ class Transaction(api.Transaction):
# For now, raise similar error to vsctl/utils.execute() # For now, raise similar error to vsctl/utils.execute()
raise RuntimeError(msg) raise RuntimeError(msg)
return return
elif status == txn.ABORTED: if status == txn.ABORTED:
LOG.debug("Transaction aborted") LOG.debug("Transaction aborted")
return return
elif status == txn.UNCHANGED: if status == txn.UNCHANGED:
LOG.debug("Transaction caused no change") LOG.debug("Transaction caused no change")
elif status == txn.SUCCESS: elif status == txn.SUCCESS:
self.post_commit(txn) self.post_commit(txn)

View File

@ -80,7 +80,7 @@ class WaitEvent(RowEvent):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.event = threading.Event() self.event = threading.Event()
self.timeout = kwargs.pop('timeout', None) self.timeout = kwargs.pop('timeout', None)
super(WaitEvent, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
@abc.abstractmethod @abc.abstractmethod
def matches(self, event, row, old=None): def matches(self, event, row, old=None):

View File

@ -24,13 +24,13 @@ class OvsdbAppException(RuntimeError):
def __init__(self, **kwargs): def __init__(self, **kwargs):
try: try:
super(OvsdbAppException, self).__init__(self.message % kwargs) super().__init__(self.message % kwargs)
self.msg = self.message % kwargs self.msg = self.message % kwargs
except Exception: except Exception:
if self.use_fatal_exceptions(): if self.use_fatal_exceptions():
raise raise
# at least get the core message out if something happened # at least get the core message out if something happened
super(OvsdbAppException, self).__init__(self.message) super().__init__(self.message)
def __str__(self): def __str__(self):
return self.msg return self.msg

View File

@ -26,7 +26,7 @@ class AddManagerCommand(command.AddCommand):
table_name = 'Manager' table_name = 'Manager'
def __init__(self, api, target): def __init__(self, api, target):
super(AddManagerCommand, self).__init__(api) super().__init__(api)
self.target = target self.target = target
def run_idl(self, txn): def run_idl(self, txn):
@ -43,7 +43,7 @@ class AddManagerCommand(command.AddCommand):
class GetManagerCommand(command.ReadOnlyCommand): class GetManagerCommand(command.ReadOnlyCommand):
def __init__(self, api): def __init__(self, api):
super(GetManagerCommand, self).__init__(api) super().__init__(api)
def run_idl(self, txn): def run_idl(self, txn):
self.result = [m.target for m in self.result = [m.target for m in
@ -52,17 +52,17 @@ class GetManagerCommand(command.ReadOnlyCommand):
class RemoveManagerCommand(BaseCommand): class RemoveManagerCommand(BaseCommand):
def __init__(self, api, target): def __init__(self, api, target):
super(RemoveManagerCommand, self).__init__(api) super().__init__(api)
self.target = target self.target = target
def run_idl(self, txn): def run_idl(self, txn):
try: try:
manager = idlutils.row_by_value(self.api.idl, 'Manager', 'target', manager = idlutils.row_by_value(self.api.idl, 'Manager', 'target',
self.target) self.target)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
msg = "Manager with target %s does not exist" % self.target msg = "Manager with target %s does not exist" % self.target
LOG.error(msg) LOG.error(msg)
raise RuntimeError(msg) raise RuntimeError(msg) from e
try: try:
self.api._ovs.delvalue('manager_options', manager) self.api._ovs.delvalue('manager_options', manager)
except AttributeError: # OVS < 2.6 except AttributeError: # OVS < 2.6
@ -77,7 +77,7 @@ class AddBridgeCommand(command.AddCommand):
table_name = 'Bridge' table_name = 'Bridge'
def __init__(self, api, name, may_exist, datapath_type): def __init__(self, api, name, may_exist, datapath_type):
super(AddBridgeCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.may_exist = may_exist self.may_exist = may_exist
self.datapath_type = datapath_type self.datapath_type = datapath_type
@ -113,7 +113,7 @@ class AddBridgeCommand(command.AddCommand):
class DelBridgeCommand(BaseCommand): class DelBridgeCommand(BaseCommand):
def __init__(self, api, name, if_exists): def __init__(self, api, name, if_exists):
super(DelBridgeCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.if_exists = if_exists self.if_exists = if_exists
@ -121,13 +121,13 @@ class DelBridgeCommand(BaseCommand):
try: try:
br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name', br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name',
self.name) self.name)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
else: else:
msg = "Bridge %s does not exist" % self.name msg = "Bridge %s does not exist" % self.name
LOG.error(msg) LOG.error(msg)
raise RuntimeError(msg) raise RuntimeError(msg) from e
# Clean up cached ports/interfaces # Clean up cached ports/interfaces
for port in br.ports: for port in br.ports:
for interface in port.interfaces: for interface in port.interfaces:
@ -145,7 +145,7 @@ class DelBridgeCommand(BaseCommand):
class BridgeExistsCommand(command.ReadOnlyCommand): class BridgeExistsCommand(command.ReadOnlyCommand):
def __init__(self, api, name): def __init__(self, api, name):
super(BridgeExistsCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
def run_idl(self, txn): def run_idl(self, txn):
@ -155,7 +155,7 @@ class BridgeExistsCommand(command.ReadOnlyCommand):
class ListBridgesCommand(command.ReadOnlyCommand): class ListBridgesCommand(command.ReadOnlyCommand):
def __init__(self, api): def __init__(self, api):
super(ListBridgesCommand, self).__init__(api) super().__init__(api)
def run_idl(self, txn): def run_idl(self, txn):
# NOTE (twilson) [x.name for x in rows.values()] if no index # NOTE (twilson) [x.name for x in rows.values()] if no index
@ -165,7 +165,7 @@ class ListBridgesCommand(command.ReadOnlyCommand):
class SetControllerCommand(BaseCommand): class SetControllerCommand(BaseCommand):
def __init__(self, api, bridge, targets): def __init__(self, api, bridge, targets):
super(SetControllerCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
self.targets = targets self.targets = targets
@ -182,7 +182,7 @@ class SetControllerCommand(BaseCommand):
class DelControllerCommand(BaseCommand): class DelControllerCommand(BaseCommand):
def __init__(self, api, bridge): def __init__(self, api, bridge):
super(DelControllerCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
def run_idl(self, txn): def run_idl(self, txn):
@ -192,7 +192,7 @@ class DelControllerCommand(BaseCommand):
class GetControllerCommand(command.ReadOnlyCommand): class GetControllerCommand(command.ReadOnlyCommand):
def __init__(self, api, bridge): def __init__(self, api, bridge):
super(GetControllerCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
def run_idl(self, txn): def run_idl(self, txn):
@ -202,7 +202,7 @@ class GetControllerCommand(command.ReadOnlyCommand):
class SetFailModeCommand(BaseCommand): class SetFailModeCommand(BaseCommand):
def __init__(self, api, bridge, mode): def __init__(self, api, bridge, mode):
super(SetFailModeCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
self.mode = mode self.mode = mode
@ -215,7 +215,7 @@ class AddPortCommand(command.AddCommand):
table_name = 'Port' table_name = 'Port'
def __init__(self, api, bridge, port, may_exist): def __init__(self, api, bridge, port, may_exist):
super(AddPortCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
self.port = port self.port = port
self.may_exist = may_exist self.may_exist = may_exist
@ -248,7 +248,7 @@ class AddPortCommand(command.AddCommand):
class DelPortCommand(BaseCommand): class DelPortCommand(BaseCommand):
def __init__(self, api, port, bridge, if_exists): def __init__(self, api, port, bridge, if_exists):
super(DelPortCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.bridge = bridge self.bridge = bridge
self.if_exists = if_exists self.if_exists = if_exists
@ -257,11 +257,11 @@ class DelPortCommand(BaseCommand):
try: try:
port = idlutils.row_by_value(self.api.idl, 'Port', 'name', port = idlutils.row_by_value(self.api.idl, 'Port', 'name',
self.port) self.port)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
msg = "Port %s does not exist" % self.port msg = "Port %s does not exist" % self.port
raise RuntimeError(msg) raise RuntimeError(msg) from e
if self.bridge: if self.bridge:
br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name', br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name',
self.bridge) self.bridge)
@ -293,7 +293,7 @@ class DelPortCommand(BaseCommand):
class ListPortsCommand(command.ReadOnlyCommand): class ListPortsCommand(command.ReadOnlyCommand):
def __init__(self, api, bridge): def __init__(self, api, bridge):
super(ListPortsCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
def run_idl(self, txn): def run_idl(self, txn):
@ -303,7 +303,7 @@ class ListPortsCommand(command.ReadOnlyCommand):
class ListIfacesCommand(command.ReadOnlyCommand): class ListIfacesCommand(command.ReadOnlyCommand):
def __init__(self, api, bridge): def __init__(self, api, bridge):
super(ListIfacesCommand, self).__init__(api) super().__init__(api)
self.bridge = bridge self.bridge = bridge
def run_idl(self, txn): def run_idl(self, txn):
@ -314,7 +314,7 @@ class ListIfacesCommand(command.ReadOnlyCommand):
class PortToBridgeCommand(command.ReadOnlyCommand): class PortToBridgeCommand(command.ReadOnlyCommand):
def __init__(self, api, name): def __init__(self, api, name):
super(PortToBridgeCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
def run_idl(self, txn): def run_idl(self, txn):
@ -330,7 +330,7 @@ class PortToBridgeCommand(command.ReadOnlyCommand):
class InterfaceToBridgeCommand(command.ReadOnlyCommand): class InterfaceToBridgeCommand(command.ReadOnlyCommand):
def __init__(self, api, name): def __init__(self, api, name):
super(InterfaceToBridgeCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
def run_idl(self, txn): def run_idl(self, txn):
@ -346,7 +346,7 @@ class InterfaceToBridgeCommand(command.ReadOnlyCommand):
class GetExternalIdCommand(command.ReadOnlyCommand): class GetExternalIdCommand(command.ReadOnlyCommand):
def __init__(self, api, table, name, field): def __init__(self, api, table, name, field):
super(GetExternalIdCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.name = name self.name = name
self.field = field self.field = field
@ -359,7 +359,7 @@ class GetExternalIdCommand(command.ReadOnlyCommand):
class SetExternalIdCommand(BaseCommand): class SetExternalIdCommand(BaseCommand):
def __init__(self, api, table, name, field, value): def __init__(self, api, table, name, field, value):
super(SetExternalIdCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.name = name self.name = name
self.field = field self.field = field
@ -375,23 +375,23 @@ class SetExternalIdCommand(BaseCommand):
class BrGetExternalIdCommand(GetExternalIdCommand): class BrGetExternalIdCommand(GetExternalIdCommand):
def __init__(self, api, name, field): def __init__(self, api, name, field):
super(BrGetExternalIdCommand, self).__init__( super().__init__(
api, 'Bridge', name, field) api, 'Bridge', name, field)
class BrSetExternalIdCommand(SetExternalIdCommand): class BrSetExternalIdCommand(SetExternalIdCommand):
def __init__(self, api, name, field, value): def __init__(self, api, name, field, value):
super(BrSetExternalIdCommand, self).__init__( super().__init__(
api, 'Bridge', name, field, value) api, 'Bridge', name, field, value)
class IfaceGetExternalIdCommand(GetExternalIdCommand): class IfaceGetExternalIdCommand(GetExternalIdCommand):
def __init__(self, api, name, field): def __init__(self, api, name, field):
super(IfaceGetExternalIdCommand, self).__init__( super().__init__(
api, 'Interface', name, field) api, 'Interface', name, field)
class IfaceSetExternalIdCommand(SetExternalIdCommand): class IfaceSetExternalIdCommand(SetExternalIdCommand):
def __init__(self, api, name, field, value): def __init__(self, api, name, field, value):
super(IfaceSetExternalIdCommand, self).__init__( super().__init__(
api, 'Interface', name, field, value) api, 'Interface', name, field, value)

View File

@ -34,7 +34,7 @@ class OvsVsctlTransaction(transaction.Transaction):
txn.expected_ifaces = set() txn.expected_ifaces = set()
def post_commit(self, txn): def post_commit(self, txn):
super(OvsVsctlTransaction, self).post_commit(txn) super().post_commit(txn)
# ovs-vsctl only logs these failures and does not return nonzero # ovs-vsctl only logs these failures and does not return nonzero
try: try:
self.do_post_commit(txn) self.do_post_commit(txn)

View File

@ -24,7 +24,7 @@ class LsAddCommand(cmd.AddCommand):
table_name = 'Logical_Switch' table_name = 'Logical_Switch'
def __init__(self, api, switch=None, may_exist=False, **columns): def __init__(self, api, switch=None, may_exist=False, **columns):
super(LsAddCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.columns = columns self.columns = columns
self.may_exist = may_exist self.may_exist = may_exist
@ -55,7 +55,7 @@ class LsAddCommand(cmd.AddCommand):
class LsDelCommand(cmd.BaseCommand): class LsDelCommand(cmd.BaseCommand):
def __init__(self, api, switch, if_exists=False): def __init__(self, api, switch, if_exists=False):
super(LsDelCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.if_exists = if_exists self.if_exists = if_exists
@ -63,11 +63,11 @@ class LsDelCommand(cmd.BaseCommand):
try: try:
lswitch = self.api.lookup('Logical_Switch', self.switch) lswitch = self.api.lookup('Logical_Switch', self.switch)
lswitch.delete() lswitch.delete()
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
msg = "Logical Switch %s does not exist" % self.switch msg = "Logical Switch %s does not exist" % self.switch
raise RuntimeError(msg) raise RuntimeError(msg) from e
class LsListCommand(cmd.ReadOnlyCommand): class LsListCommand(cmd.ReadOnlyCommand):
@ -93,7 +93,7 @@ class _AclAddHelper(cmd.AddCommand):
const.ACL_PRIORITY_MAX)) const.ACL_PRIORITY_MAX))
if action not in ('allow', 'allow-related', 'drop', 'reject'): if action not in ('allow', 'allow-related', 'drop', 'reject'):
raise TypeError("action must be allow/allow-related/drop/reject") raise TypeError("action must be allow/allow-related/drop/reject")
super(_AclAddHelper, self).__init__(api) super().__init__(api)
self.entity = entity self.entity = entity
self.direction = direction self.direction = direction
self.priority = priority self.priority = priority
@ -141,9 +141,9 @@ class AclAddCommand(_AclAddHelper):
**external_ids): **external_ids):
# NOTE: we're overriding the constructor here to not break any # NOTE: we're overriding the constructor here to not break any
# existing callers before we introduced Port Groups. # existing callers before we introduced Port Groups.
super(AclAddCommand, self).__init__(api, switch, direction, priority, super().__init__(api, switch, direction, priority,
match, action, log, may_exist, match, action, log, may_exist,
severity, name, **external_ids) severity, name, **external_ids)
class PgAclAddCommand(_AclAddHelper): class PgAclAddCommand(_AclAddHelper):
@ -157,7 +157,7 @@ class _AclDelHelper(cmd.BaseCommand):
raise TypeError("Must specify priority and match together") raise TypeError("Must specify priority and match together")
if priority is not None and not direction: if priority is not None and not direction:
raise TypeError("Cannot specify priority/match without direction") raise TypeError("Cannot specify priority/match without direction")
super(_AclDelHelper, self).__init__(api) super().__init__(api)
self.entity = entity self.entity = entity
self.conditions = [] self.conditions = []
if direction: if direction:
@ -182,8 +182,7 @@ class AclDelCommand(_AclDelHelper):
priority=None, match=None): priority=None, match=None):
# NOTE: we're overriding the constructor here to not break any # NOTE: we're overriding the constructor here to not break any
# existing callers before we introduced Port Groups. # existing callers before we introduced Port Groups.
super(AclDelCommand, self).__init__(api, switch, direction, priority, super().__init__(api, switch, direction, priority, match)
match)
class PgAclDelCommand(_AclDelHelper): class PgAclDelCommand(_AclDelHelper):
@ -192,7 +191,7 @@ class PgAclDelCommand(_AclDelHelper):
class _AclListHelper(cmd.ReadOnlyCommand): class _AclListHelper(cmd.ReadOnlyCommand):
def __init__(self, api, entity): def __init__(self, api, entity):
super(_AclListHelper, self).__init__(api) super().__init__(api)
self.entity = entity self.entity = entity
def run_idl(self, txn): def run_idl(self, txn):
@ -229,7 +228,7 @@ class QoSAddCommand(cmd.AddCommand):
dscp, const.QOS_DSCP_MAX) dscp, const.QOS_DSCP_MAX)
if rate is None and dscp is None: if rate is None and dscp is None:
raise ValueError("One of the rate or dscp must be configured") raise ValueError("One of the rate or dscp must be configured")
super(QoSAddCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.direction = direction self.direction = direction
self.priority = priority self.priority = priority
@ -275,7 +274,7 @@ class QoSDelCommand(cmd.BaseCommand):
raise TypeError("Must specify priority and match together") raise TypeError("Must specify priority and match together")
if priority is not None and not direction: if priority is not None and not direction:
raise TypeError("Cannot specify priority/match without direction") raise TypeError("Cannot specify priority/match without direction")
super(QoSDelCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.conditions = [] self.conditions = []
self.if_exists = if_exists self.if_exists = if_exists
@ -289,11 +288,11 @@ class QoSDelCommand(cmd.BaseCommand):
def run_idl(self, txn): def run_idl(self, txn):
try: try:
ls = self.api.lookup('Logical_Switch', self.switch) ls = self.api.lookup('Logical_Switch', self.switch)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
msg = 'Logical Switch %s does not exist' % self.switch msg = 'Logical Switch %s does not exist' % self.switch
raise RuntimeError(msg) raise RuntimeError(msg) from e
for row in ls.qos_rules: for row in ls.qos_rules:
if idlutils.row_match(row, self.conditions): if idlutils.row_match(row, self.conditions):
@ -303,7 +302,7 @@ class QoSDelCommand(cmd.BaseCommand):
class QoSListCommand(cmd.ReadOnlyCommand): class QoSListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, switch): def __init__(self, api, switch):
super(QoSListCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
def run_idl(self, txn): def run_idl(self, txn):
@ -315,7 +314,7 @@ class QoSDelExtIdCommand(cmd.BaseCommand):
def __init__(self, api, lswitch, external_ids, if_exists=False): def __init__(self, api, lswitch, external_ids, if_exists=False):
if not external_ids: if not external_ids:
raise TypeError('external_ids dictionary cannot be empty') raise TypeError('external_ids dictionary cannot be empty')
super(QoSDelExtIdCommand, self).__init__(api) super().__init__(api)
self.lswitch = lswitch self.lswitch = lswitch
self.external_ids = external_ids self.external_ids = external_ids
self.if_exists = if_exists self.if_exists = if_exists
@ -324,11 +323,11 @@ class QoSDelExtIdCommand(cmd.BaseCommand):
try: try:
lswitch = idlutils.row_by_value(self.api.idl, 'Logical_Switch', lswitch = idlutils.row_by_value(self.api.idl, 'Logical_Switch',
'name', self.lswitch) 'name', self.lswitch)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
msg = 'Logical Switch %s does not exist' % self.lswitch msg = 'Logical Switch %s does not exist' % self.lswitch
raise RuntimeError(msg) raise RuntimeError(msg) from e
for qos in lswitch.qos_rules: for qos in lswitch.qos_rules:
if self.external_ids.items() <= qos.external_ids.items(): if self.external_ids.items() <= qos.external_ids.items():
@ -345,7 +344,7 @@ class LspAddCommand(cmd.AddCommand):
raise TypeError("tag must be 0 to 4095, inclusive") raise TypeError("tag must be 0 to 4095, inclusive")
if (parent_name is None) != (tag is None): if (parent_name is None) != (tag is None):
raise TypeError("parent_name and tag must be passed together") raise TypeError("parent_name and tag must be passed together")
super(LspAddCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.port = port self.port = port
self.parent = parent_name self.parent = parent_name
@ -394,7 +393,7 @@ class LspAddCommand(cmd.AddCommand):
class PortDelCommand(cmd.BaseCommand): class PortDelCommand(cmd.BaseCommand):
def __init__(self, api, table, port, parent_table, parent=None, def __init__(self, api, table, port, parent_table, parent=None,
if_exists=False): if_exists=False):
super(PortDelCommand, self).__init__(api) super().__init__(api)
self.table = table self.table = table
self.port = port self.port = port
self.parent_table = parent_table self.parent_table = parent_table
@ -404,10 +403,10 @@ class PortDelCommand(cmd.BaseCommand):
def run_idl(self, txn): def run_idl(self, txn):
try: try:
row = self.api.lookup(self.table, self.port) row = self.api.lookup(self.table, self.port)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
raise RuntimeError("%s does not exist" % self.port) raise RuntimeError("%s does not exist" % self.port) from e
# We need to delete the port from its parent # We need to delete the port from its parent
if self.parent: if self.parent:
@ -425,14 +424,14 @@ class PortDelCommand(cmd.BaseCommand):
class LspDelCommand(PortDelCommand): class LspDelCommand(PortDelCommand):
def __init__(self, api, port, switch=None, if_exists=False): def __init__(self, api, port, switch=None, if_exists=False):
super(LspDelCommand, self).__init__( super().__init__(
api, 'Logical_Switch_Port', port, 'Logical_Switch', switch, api, 'Logical_Switch_Port', port, 'Logical_Switch', switch,
if_exists) if_exists)
class LspListCommand(cmd.ReadOnlyCommand): class LspListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, switch=None): def __init__(self, api, switch=None):
super(LspListCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
def run_idl(self, txn): def run_idl(self, txn):
@ -449,7 +448,7 @@ class LspGetCommand(cmd.BaseGetRowCommand):
class LspGetParentCommand(cmd.ReadOnlyCommand): class LspGetParentCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetParentCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -459,7 +458,7 @@ class LspGetParentCommand(cmd.ReadOnlyCommand):
class LspGetTagCommand(cmd.ReadOnlyCommand): class LspGetTagCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetTagCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -477,7 +476,7 @@ class LspSetAddressesCommand(cmd.BaseCommand):
raise TypeError( raise TypeError(
"address (%s) must be router/unknown/dynamic/" "address (%s) must be router/unknown/dynamic/"
"ethaddr[ ipaddr...]" % (addr,)) "ethaddr[ ipaddr...]" % (addr,))
super(LspSetAddressesCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.addresses = addresses self.addresses = addresses
@ -488,7 +487,7 @@ class LspSetAddressesCommand(cmd.BaseCommand):
class LspGetAddressesCommand(cmd.ReadOnlyCommand): class LspGetAddressesCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetAddressesCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -500,7 +499,7 @@ class LspSetPortSecurityCommand(cmd.BaseCommand):
def __init__(self, api, port, addresses): def __init__(self, api, port, addresses):
# NOTE(twilson) ovn-nbctl.c does not do any checking of addresses # NOTE(twilson) ovn-nbctl.c does not do any checking of addresses
# so neither do we # so neither do we
super(LspSetPortSecurityCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.addresses = addresses self.addresses = addresses
@ -511,7 +510,7 @@ class LspSetPortSecurityCommand(cmd.BaseCommand):
class LspGetPortSecurityCommand(cmd.ReadOnlyCommand): class LspGetPortSecurityCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetPortSecurityCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -521,7 +520,7 @@ class LspGetPortSecurityCommand(cmd.ReadOnlyCommand):
class LspGetUpCommand(cmd.ReadOnlyCommand): class LspGetUpCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetUpCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -532,7 +531,7 @@ class LspGetUpCommand(cmd.ReadOnlyCommand):
class LspSetEnabledCommand(cmd.BaseCommand): class LspSetEnabledCommand(cmd.BaseCommand):
def __init__(self, api, port, is_enabled): def __init__(self, api, port, is_enabled):
super(LspSetEnabledCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.is_enabled = is_enabled self.is_enabled = is_enabled
@ -543,7 +542,7 @@ class LspSetEnabledCommand(cmd.BaseCommand):
class LspGetEnabledCommand(cmd.ReadOnlyCommand): class LspGetEnabledCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetEnabledCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -554,7 +553,7 @@ class LspGetEnabledCommand(cmd.ReadOnlyCommand):
class LspSetTypeCommand(cmd.BaseCommand): class LspSetTypeCommand(cmd.BaseCommand):
def __init__(self, api, port, port_type): def __init__(self, api, port, port_type):
super(LspSetTypeCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.port_type = port_type self.port_type = port_type
@ -565,7 +564,7 @@ class LspSetTypeCommand(cmd.BaseCommand):
class LspGetTypeCommand(cmd.ReadOnlyCommand): class LspGetTypeCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetTypeCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -577,7 +576,7 @@ class LspSetOptionsCommand(cmd.BaseCommand):
table = 'Logical_Switch_Port' table = 'Logical_Switch_Port'
def __init__(self, api, port, **options): def __init__(self, api, port, **options):
super(LspSetOptionsCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.options = options self.options = options
@ -590,7 +589,7 @@ class LspGetOptionsCommand(cmd.ReadOnlyCommand):
table = 'Logical_Switch_Port' table = 'Logical_Switch_Port'
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetOptionsCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -600,7 +599,7 @@ class LspGetOptionsCommand(cmd.ReadOnlyCommand):
class LspSetDhcpV4OptionsCommand(cmd.BaseCommand): class LspSetDhcpV4OptionsCommand(cmd.BaseCommand):
def __init__(self, api, port, dhcpopt_uuid): def __init__(self, api, port, dhcpopt_uuid):
super(LspSetDhcpV4OptionsCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.dhcpopt_uuid = dhcpopt_uuid self.dhcpopt_uuid = dhcpopt_uuid
@ -611,7 +610,7 @@ class LspSetDhcpV4OptionsCommand(cmd.BaseCommand):
class LspGetDhcpV4OptionsCommand(cmd.ReadOnlyCommand): class LspGetDhcpV4OptionsCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LspGetDhcpV4OptionsCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -625,7 +624,7 @@ class DhcpOptionsAddCommand(cmd.AddCommand):
def __init__(self, api, cidr, **external_ids): def __init__(self, api, cidr, **external_ids):
cidr = netaddr.IPNetwork(cidr) cidr = netaddr.IPNetwork(cidr)
super(DhcpOptionsAddCommand, self).__init__(api) super().__init__(api)
self.cidr = str(cidr) self.cidr = str(cidr)
self.external_ids = external_ids self.external_ids = external_ids
@ -638,7 +637,7 @@ class DhcpOptionsAddCommand(cmd.AddCommand):
class DhcpOptionsDelCommand(cmd.BaseCommand): class DhcpOptionsDelCommand(cmd.BaseCommand):
def __init__(self, api, dhcpopt_uuid): def __init__(self, api, dhcpopt_uuid):
super(DhcpOptionsDelCommand, self).__init__(api) super().__init__(api)
self.dhcpopt_uuid = dhcpopt_uuid self.dhcpopt_uuid = dhcpopt_uuid
def run_idl(self, txn): def run_idl(self, txn):
@ -658,7 +657,7 @@ class DhcpOptionsGetCommand(cmd.BaseGetRowCommand):
class DhcpOptionsSetOptionsCommand(cmd.BaseCommand): class DhcpOptionsSetOptionsCommand(cmd.BaseCommand):
def __init__(self, api, dhcpopt_uuid, **options): def __init__(self, api, dhcpopt_uuid, **options):
super(DhcpOptionsSetOptionsCommand, self).__init__(api) super().__init__(api)
self.dhcpopt_uuid = dhcpopt_uuid self.dhcpopt_uuid = dhcpopt_uuid
self.options = options self.options = options
@ -669,7 +668,7 @@ class DhcpOptionsSetOptionsCommand(cmd.BaseCommand):
class DhcpOptionsGetOptionsCommand(cmd.ReadOnlyCommand): class DhcpOptionsGetOptionsCommand(cmd.ReadOnlyCommand):
def __init__(self, api, dhcpopt_uuid): def __init__(self, api, dhcpopt_uuid):
super(DhcpOptionsGetOptionsCommand, self).__init__(api) super().__init__(api)
self.dhcpopt_uuid = dhcpopt_uuid self.dhcpopt_uuid = dhcpopt_uuid
def run_idl(self, txn): def run_idl(self, txn):
@ -679,7 +678,7 @@ class DhcpOptionsGetOptionsCommand(cmd.ReadOnlyCommand):
class LrAddCommand(cmd.BaseCommand): class LrAddCommand(cmd.BaseCommand):
def __init__(self, api, router=None, may_exist=False, **columns): def __init__(self, api, router=None, may_exist=False, **columns):
super(LrAddCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.may_exist = may_exist self.may_exist = may_exist
self.columns = columns self.columns = columns
@ -707,7 +706,7 @@ class LrAddCommand(cmd.BaseCommand):
class LrDelCommand(cmd.BaseCommand): class LrDelCommand(cmd.BaseCommand):
def __init__(self, api, router, if_exists=False): def __init__(self, api, router, if_exists=False):
super(LrDelCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.if_exists = if_exists self.if_exists = if_exists
@ -715,11 +714,11 @@ class LrDelCommand(cmd.BaseCommand):
try: try:
lr = self.api.lookup('Logical_Router', self.router) lr = self.api.lookup('Logical_Router', self.router)
lr.delete() lr.delete()
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
msg = "Logical Router %s does not exist" % self.router msg = "Logical Router %s does not exist" % self.router
raise RuntimeError(msg) raise RuntimeError(msg) from e
class LrListCommand(cmd.ReadOnlyCommand): class LrListCommand(cmd.ReadOnlyCommand):
@ -742,7 +741,7 @@ class LrpAddCommand(cmd.BaseCommand):
self.peer = peer self.peer = peer
self.may_exist = may_exist self.may_exist = may_exist
self.columns = columns self.columns = columns
super(LrpAddCommand, self).__init__(api) super().__init__(api)
def run_idl(self, txn): def run_idl(self, txn):
lr = self.api.lookup('Logical_Router', self.router) lr = self.api.lookup('Logical_Router', self.router)
@ -794,14 +793,14 @@ class LrpAddCommand(cmd.BaseCommand):
class LrpDelCommand(PortDelCommand): class LrpDelCommand(PortDelCommand):
def __init__(self, api, port, router=None, if_exists=False): def __init__(self, api, port, router=None, if_exists=False):
super(LrpDelCommand, self).__init__( super().__init__(
api, 'Logical_Router_Port', port, 'Logical_Router', router, api, 'Logical_Router_Port', port, 'Logical_Router', router,
if_exists) if_exists)
class LrpListCommand(cmd.ReadOnlyCommand): class LrpListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, router): def __init__(self, api, router):
super(LrpListCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
def run_idl(self, txn): def run_idl(self, txn):
@ -811,7 +810,7 @@ class LrpListCommand(cmd.ReadOnlyCommand):
class LrpSetEnabledCommand(cmd.BaseCommand): class LrpSetEnabledCommand(cmd.BaseCommand):
def __init__(self, api, port, is_enabled): def __init__(self, api, port, is_enabled):
super(LrpSetEnabledCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.is_enabled = is_enabled self.is_enabled = is_enabled
@ -822,7 +821,7 @@ class LrpSetEnabledCommand(cmd.BaseCommand):
class LrpGetEnabledCommand(cmd.ReadOnlyCommand): class LrpGetEnabledCommand(cmd.ReadOnlyCommand):
def __init__(self, api, port): def __init__(self, api, port):
super(LrpGetEnabledCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
def run_idl(self, txn): def run_idl(self, txn):
@ -844,7 +843,7 @@ class LrRouteAddCommand(cmd.BaseCommand):
policy='dst-ip', may_exist=False): policy='dst-ip', may_exist=False):
prefix = str(netaddr.IPNetwork(prefix)) prefix = str(netaddr.IPNetwork(prefix))
nexthop = str(netaddr.IPAddress(nexthop)) nexthop = str(netaddr.IPAddress(nexthop))
super(LrRouteAddCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.prefix = prefix self.prefix = prefix
self.nexthop = nexthop self.nexthop = nexthop
@ -887,7 +886,7 @@ class LrRouteDelCommand(cmd.BaseCommand):
def __init__(self, api, router, prefix=None, if_exists=False): def __init__(self, api, router, prefix=None, if_exists=False):
if prefix is not None: if prefix is not None:
prefix = str(netaddr.IPNetwork(prefix)) prefix = str(netaddr.IPNetwork(prefix))
super(LrRouteDelCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.prefix = prefix self.prefix = prefix
self.if_exists = if_exists self.if_exists = if_exists
@ -911,7 +910,7 @@ class LrRouteDelCommand(cmd.BaseCommand):
class LrRouteListCommand(cmd.ReadOnlyCommand): class LrRouteListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, router): def __init__(self, api, router):
super(LrRouteListCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
def run_idl(self, txn): def run_idl(self, txn):
@ -940,7 +939,7 @@ class LrNatAddCommand(cmd.BaseCommand):
if external_mac: if external_mac:
external_mac = str( external_mac = str(
netaddr.EUI(external_mac, dialect=netaddr.mac_unix_expanded)) netaddr.EUI(external_mac, dialect=netaddr.mac_unix_expanded))
super(LrNatAddCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.nat_type = nat_type self.nat_type = nat_type
self.external_ip = external_ip self.external_ip = external_ip
@ -985,7 +984,7 @@ class LrNatAddCommand(cmd.BaseCommand):
class LrNatDelCommand(cmd.BaseCommand): class LrNatDelCommand(cmd.BaseCommand):
def __init__(self, api, router, nat_type=None, match_ip=None, def __init__(self, api, router, nat_type=None, match_ip=None,
if_exists=False): if_exists=False):
super(LrNatDelCommand, self).__init__(api) super().__init__(api)
self.conditions = [] self.conditions = []
if nat_type: if nat_type:
if nat_type not in const.NAT_TYPES: if nat_type not in const.NAT_TYPES:
@ -1027,7 +1026,7 @@ class LrNatDelCommand(cmd.BaseCommand):
class LrNatListCommand(cmd.ReadOnlyCommand): class LrNatListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, router): def __init__(self, api, router):
super(LrNatListCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
def run_idl(self, txn): def run_idl(self, txn):
@ -1038,7 +1037,7 @@ class LrNatListCommand(cmd.ReadOnlyCommand):
class LbAddCommand(cmd.BaseCommand): class LbAddCommand(cmd.BaseCommand):
def __init__(self, api, lb, vip, ips, protocol=const.PROTO_TCP, def __init__(self, api, lb, vip, ips, protocol=const.PROTO_TCP,
may_exist=False, **columns): may_exist=False, **columns):
super(LbAddCommand, self).__init__(api) super().__init__(api)
self.lb = lb self.lb = lb
self.vip = utils.normalize_ip_port(vip) self.vip = utils.normalize_ip_port(vip)
self.ips = ",".join(utils.normalize_ip_port(ip) for ip in ips) self.ips = ",".join(utils.normalize_ip_port(ip) for ip in ips)
@ -1072,7 +1071,7 @@ class LbAddCommand(cmd.BaseCommand):
class LbDelCommand(cmd.BaseCommand): class LbDelCommand(cmd.BaseCommand):
def __init__(self, api, lb, vip=None, if_exists=False): def __init__(self, api, lb, vip=None, if_exists=False):
super(LbDelCommand, self).__init__(api) super().__init__(api)
self.lb = lb self.lb = lb
self.vip = utils.normalize_ip_port(vip) if vip else vip self.vip = utils.normalize_ip_port(vip) if vip else vip
self.if_exists = if_exists self.if_exists = if_exists
@ -1103,7 +1102,7 @@ class LbListCommand(cmd.ReadOnlyCommand):
class LrLbAddCommand(cmd.BaseCommand): class LrLbAddCommand(cmd.BaseCommand):
def __init__(self, api, router, lb, may_exist=False): def __init__(self, api, router, lb, may_exist=False):
super(LrLbAddCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.lb = lb self.lb = lb
self.may_exist = may_exist self.may_exist = may_exist
@ -1121,7 +1120,7 @@ class LrLbAddCommand(cmd.BaseCommand):
class LrLbDelCommand(cmd.BaseCommand): class LrLbDelCommand(cmd.BaseCommand):
def __init__(self, api, router, lb=None, if_exists=False): def __init__(self, api, router, lb=None, if_exists=False):
super(LrLbDelCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
self.lb = lb self.lb = lb
self.if_exists = if_exists self.if_exists = if_exists
@ -1142,7 +1141,7 @@ class LrLbDelCommand(cmd.BaseCommand):
class LrLbListCommand(cmd.ReadOnlyCommand): class LrLbListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, router): def __init__(self, api, router):
super(LrLbListCommand, self).__init__(api) super().__init__(api)
self.router = router self.router = router
def run_idl(self, txn): def run_idl(self, txn):
@ -1152,7 +1151,7 @@ class LrLbListCommand(cmd.ReadOnlyCommand):
class LsLbAddCommand(cmd.BaseCommand): class LsLbAddCommand(cmd.BaseCommand):
def __init__(self, api, switch, lb, may_exist=False): def __init__(self, api, switch, lb, may_exist=False):
super(LsLbAddCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.lb = lb self.lb = lb
self.may_exist = may_exist self.may_exist = may_exist
@ -1170,7 +1169,7 @@ class LsLbAddCommand(cmd.BaseCommand):
class LsLbDelCommand(cmd.BaseCommand): class LsLbDelCommand(cmd.BaseCommand):
def __init__(self, api, switch, lb=None, if_exists=False): def __init__(self, api, switch, lb=None, if_exists=False):
super(LsLbDelCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
self.lb = lb self.lb = lb
self.if_exists = if_exists self.if_exists = if_exists
@ -1191,7 +1190,7 @@ class LsLbDelCommand(cmd.BaseCommand):
class LsLbListCommand(cmd.ReadOnlyCommand): class LsLbListCommand(cmd.ReadOnlyCommand):
def __init__(self, api, switch): def __init__(self, api, switch):
super(LsLbListCommand, self).__init__(api) super().__init__(api)
self.switch = switch self.switch = switch
def run_idl(self, txn): def run_idl(self, txn):
@ -1203,7 +1202,7 @@ class DnsAddCommand(cmd.AddCommand):
table_name = 'DNS' table_name = 'DNS'
def __init__(self, api, **columns): def __init__(self, api, **columns):
super(DnsAddCommand, self).__init__(api) super().__init__(api)
self.columns = columns self.columns = columns
def run_idl(self, txn): def run_idl(self, txn):
@ -1217,7 +1216,7 @@ class DnsAddCommand(cmd.AddCommand):
class DnsDelCommand(cmd.DbDestroyCommand): class DnsDelCommand(cmd.DbDestroyCommand):
def __init__(self, api, uuid): def __init__(self, api, uuid):
super(DnsDelCommand, self).__init__(api, 'DNS', uuid) super().__init__(api, 'DNS', uuid)
class DnsGetCommand(cmd.BaseGetRowCommand): class DnsGetCommand(cmd.BaseGetRowCommand):
@ -1232,7 +1231,7 @@ class DnsListCommand(cmd.ReadOnlyCommand):
class DnsSetRecordsCommand(cmd.BaseCommand): class DnsSetRecordsCommand(cmd.BaseCommand):
def __init__(self, api, row_uuid, **records): def __init__(self, api, row_uuid, **records):
super(DnsSetRecordsCommand, self).__init__(api) super().__init__(api)
self.row_uuid = row_uuid self.row_uuid = row_uuid
self.records = records self.records = records
@ -1240,14 +1239,14 @@ class DnsSetRecordsCommand(cmd.BaseCommand):
try: try:
dns = self.api.lookup('DNS', self.row_uuid) dns = self.api.lookup('DNS', self.row_uuid)
dns.records = self.records dns.records = self.records
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
msg = "DNS %s does not exist" % self.row_uuid msg = "DNS %s does not exist" % self.row_uuid
raise RuntimeError(msg) raise RuntimeError(msg) from e
class DnsSetExternalIdsCommand(cmd.BaseCommand): class DnsSetExternalIdsCommand(cmd.BaseCommand):
def __init__(self, api, row_uuid, **external_ids): def __init__(self, api, row_uuid, **external_ids):
super(DnsSetExternalIdsCommand, self).__init__(api) super().__init__(api)
self.row_uuid = row_uuid self.row_uuid = row_uuid
self.external_ids = external_ids self.external_ids = external_ids
@ -1255,16 +1254,16 @@ class DnsSetExternalIdsCommand(cmd.BaseCommand):
try: try:
dns = self.api.lookup('DNS', self.row_uuid) dns = self.api.lookup('DNS', self.row_uuid)
dns.external_ids = self.external_ids dns.external_ids = self.external_ids
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
msg = "DNS %s does not exist" % self.row_uuid msg = "DNS %s does not exist" % self.row_uuid
raise RuntimeError(msg) raise RuntimeError(msg) from e
class PgAddCommand(cmd.AddCommand): class PgAddCommand(cmd.AddCommand):
table_name = 'Port_Group' table_name = 'Port_Group'
def __init__(self, api, name, may_exist=False, **columns): def __init__(self, api, name, may_exist=False, **columns):
super(PgAddCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.may_exist = may_exist self.may_exist = may_exist
self.columns = columns self.columns = columns
@ -1288,7 +1287,7 @@ class PgDelCommand(cmd.BaseCommand):
table_name = 'Port_Group' table_name = 'Port_Group'
def __init__(self, api, name, if_exists=False): def __init__(self, api, name, if_exists=False):
super(PgDelCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.if_exists = if_exists self.if_exists = if_exists
@ -1296,17 +1295,18 @@ class PgDelCommand(cmd.BaseCommand):
try: try:
pg = self.api.lookup(self.table_name, self.name) pg = self.api.lookup(self.table_name, self.name)
pg.delete() pg.delete()
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
raise RuntimeError('Port group %s does not exist' % self.name) raise RuntimeError(
'Port group %s does not exist' % self.name) from e
class _PgUpdatePortsHelper(cmd.BaseCommand): class _PgUpdatePortsHelper(cmd.BaseCommand):
method = None method = None
def __init__(self, api, port_group, lsp=None, if_exists=False): def __init__(self, api, port_group, lsp=None, if_exists=False):
super(_PgUpdatePortsHelper, self).__init__(api) super().__init__(api)
self.port_group = port_group self.port_group = port_group
self.lsp = [] if lsp is None else self._listify(lsp) self.lsp = [] if lsp is None else self._listify(lsp)
self.if_exists = if_exists self.if_exists = if_exists
@ -1323,20 +1323,20 @@ class _PgUpdatePortsHelper(cmd.BaseCommand):
elif utils.is_uuid_like(port): elif utils.is_uuid_like(port):
try: try:
port = self.api.lookup('Logical_Switch_Port', port) port = self.api.lookup('Logical_Switch_Port', port)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
raise RuntimeError( raise RuntimeError(
'Port %s does not exist' % port) 'Port %s does not exist' % port) from e
getattr(pg, self.method)('ports', port) getattr(pg, self.method)('ports', port)
def run_idl(self, txn): def run_idl(self, txn):
try: try:
pg = self.api.lookup('Port_Group', self.port_group) pg = self.api.lookup('Port_Group', self.port_group)
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
raise RuntimeError('Port group %s does not exist' % raise RuntimeError('Port group %s does not exist' %
self.port_group) self.port_group) from e
for lsp in self.lsp: for lsp in self.lsp:
self._run_method(pg, lsp) self._run_method(pg, lsp)
@ -1359,7 +1359,7 @@ class GatewayChassisAddCommand(cmd.AddCommand):
def __init__(self, api, name, chassis_name, priority=0, may_exist=False, def __init__(self, api, name, chassis_name, priority=0, may_exist=False,
**columns): **columns):
super(GatewayChassisAddCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.chassis_name = chassis_name self.chassis_name = chassis_name
self.priority = priority self.priority = priority
@ -1385,7 +1385,7 @@ class HAChassisGroupAddCommand(cmd.AddCommand):
table_name = 'HA_Chassis_Group' table_name = 'HA_Chassis_Group'
def __init__(self, api, name, may_exist=False, **columns): def __init__(self, api, name, may_exist=False, **columns):
super(HAChassisGroupAddCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.may_exist = may_exist self.may_exist = may_exist
self.columns = columns self.columns = columns
@ -1409,7 +1409,7 @@ class HAChassisGroupDelCommand(cmd.BaseCommand):
table_name = 'HA_Chassis_Group' table_name = 'HA_Chassis_Group'
def __init__(self, api, name, if_exists=False): def __init__(self, api, name, if_exists=False):
super(HAChassisGroupDelCommand, self).__init__(api) super().__init__(api)
self.name = name self.name = name
self.if_exists = if_exists self.if_exists = if_exists
@ -1417,11 +1417,11 @@ class HAChassisGroupDelCommand(cmd.BaseCommand):
try: try:
hcg = self.api.lookup(self.table_name, self.name) hcg = self.api.lookup(self.table_name, self.name)
hcg.delete() hcg.delete()
except idlutils.RowNotFound: except idlutils.RowNotFound as e:
if self.if_exists: if self.if_exists:
return return
raise RuntimeError( raise RuntimeError(
'HA Chassis Group %s does not exist' % self.name) 'HA Chassis Group %s does not exist' % self.name) from e
class HAChassisGroupGetCommand(cmd.BaseGetRowCommand): class HAChassisGroupGetCommand(cmd.BaseGetRowCommand):
@ -1432,7 +1432,7 @@ class HAChassisGroupAddChassisCommand(cmd.AddCommand):
table_name = 'HA_Chassis' table_name = 'HA_Chassis'
def __init__(self, api, hcg_id, chassis, priority, **columns): def __init__(self, api, hcg_id, chassis, priority, **columns):
super(HAChassisGroupAddChassisCommand, self).__init__(api) super().__init__(api)
self.hcg_id = hcg_id self.hcg_id = hcg_id
self.chassis = chassis self.chassis = chassis
self.priority = priority self.priority = priority
@ -1463,7 +1463,7 @@ class HAChassisGroupDelChassisCommand(cmd.BaseCommand):
table_name = 'HA_Chassis' table_name = 'HA_Chassis'
def __init__(self, api, hcg_id, chassis, if_exists=False): def __init__(self, api, hcg_id, chassis, if_exists=False):
super(HAChassisGroupDelChassisCommand, self).__init__(api) super().__init__(api)
self.hcg_id = hcg_id self.hcg_id = hcg_id
self.chassis = chassis self.chassis = chassis
self.if_exists = if_exists self.if_exists = if_exists

View File

@ -20,7 +20,7 @@ class ChassisAddCommand(cmd.AddCommand):
def __init__(self, api, chassis, encap_types, encap_ip, may_exist=False, def __init__(self, api, chassis, encap_types, encap_ip, may_exist=False,
**columns): **columns):
super(ChassisAddCommand, self).__init__(api) super().__init__(api)
self.chassis = chassis self.chassis = chassis
self.encap_types = encap_types self.encap_types = encap_types
self.encap_ip = encap_ip self.encap_ip = encap_ip
@ -57,7 +57,7 @@ class ChassisAddCommand(cmd.AddCommand):
class ChassisDelCommand(cmd.BaseCommand): class ChassisDelCommand(cmd.BaseCommand):
def __init__(self, api, chassis, if_exists=False): def __init__(self, api, chassis, if_exists=False):
super(ChassisDelCommand, self).__init__(api) super().__init__(api)
self.chassis = chassis self.chassis = chassis
self.if_exists = if_exists self.if_exists = if_exists
@ -83,7 +83,7 @@ class ChassisListCommand(cmd.ReadOnlyCommand):
class LspBindCommand(cmd.BaseCommand): class LspBindCommand(cmd.BaseCommand):
def __init__(self, api, port, chassis, may_exist=False): def __init__(self, api, port, chassis, may_exist=False):
super(LspBindCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.chassis = chassis self.chassis = chassis
self.may_exist = may_exist self.may_exist = may_exist
@ -102,7 +102,7 @@ class LspBindCommand(cmd.BaseCommand):
class LspUnbindCommand(cmd.BaseCommand): class LspUnbindCommand(cmd.BaseCommand):
def __init__(self, api, port, if_exists=False): def __init__(self, api, port, if_exists=False):
super(LspUnbindCommand, self).__init__(api) super().__init__(api)
self.port = port self.port = port
self.if_exists = if_exists self.if_exists = if_exists

View File

@ -25,23 +25,23 @@ def normalize_ip(ip):
def normalize_ip_port(ipport): def normalize_ip_port(ipport):
try: try:
return normalize_ip(ipport) return normalize_ip(ipport)
except netaddr.AddrFormatError: except netaddr.AddrFormatError as e:
# maybe we have a port # maybe we have a port
if ipport[0] == '[': if ipport[0] == '[':
# Should be an IPv6 w/ port # Should be an IPv6 w/ port
try: try:
ip, port = ipport[1:].split(']:') ip, port = ipport[1:].split(']:')
except ValueError: except ValueError as e2:
raise netaddr.AddrFormatError("Invalid Port") raise netaddr.AddrFormatError("Invalid Port") from e2
ip = "[%s]" % normalize_ip(ip) ip = "[%s]" % normalize_ip(ip)
else: else:
try: try:
ip, port = ipport.split(':') ip, port = ipport.split(':')
except ValueError: except ValueError as e3:
raise netaddr.AddrFormatError("Invalid Port") raise netaddr.AddrFormatError("Invalid Port") from e3
ip = normalize_ip(ip) ip = normalize_ip(ip)
if int(port) <= 0 or int(port) > 65535: if int(port) <= 0 or int(port) > 65535:
raise netaddr.AddrFormatError("Invalid port") raise netaddr.AddrFormatError("Invalid port") from e
return "%s:%s" % (ip, port) return "%s:%s" % (ip, port)

View File

@ -90,7 +90,7 @@ class OvsVenvFixture(fixtures.Fixture):
return 'unix:' + os.path.join(self.venv, 'db.sock') return 'unix:' + os.path.join(self.venv, 'db.sock')
def _setUp(self): def _setUp(self):
super(OvsVenvFixture, self)._setUp() super()._setUp()
self.addCleanup(self.deactivate) self.addCleanup(self.deactivate)
if not os.path.isdir(self.venv): if not os.path.isdir(self.venv):
os.mkdir(self.venv) os.mkdir(self.venv)
@ -160,7 +160,7 @@ class OvsOvnVenvFixture(OvsVenvFixture):
# Use OVN source dir # Use OVN source dir
self.PATH_VAR_TEMPLATE += ( self.PATH_VAR_TEMPLATE += (
":{0}/controller:{0}/northd:{0}/utilities".format(ovndir)) ":{0}/controller:{0}/northd:{0}/utilities".format(ovndir))
super(OvsOvnVenvFixture, self).__init__(venv, **kwargs) super().__init__(venv, **kwargs)
self.ovndir = self._share_path(self.OVN_PATHS, ovndir, self.ovndir = self._share_path(self.OVN_PATHS, ovndir,
[self.SBSCHEMA, self.NBSCHEMA]) [self.SBSCHEMA, self.NBSCHEMA])
self.env.update({'OVN_RUNDIR': self.venv}) self.env.update({'OVN_RUNDIR': self.venv})
@ -182,12 +182,12 @@ class OvsOvnVenvFixture(OvsVenvFixture):
return 'unix:' + os.path.join(self.venv, 'ovnsb_db.sock') return 'unix:' + os.path.join(self.venv, 'ovnsb_db.sock')
def setup_dbs(self): def setup_dbs(self):
super(OvsOvnVenvFixture, self).setup_dbs() super().setup_dbs()
self.create_db('ovnsb.db', self.ovnsb_schema) self.create_db('ovnsb.db', self.ovnsb_schema)
self.create_db('ovnnb.db', self.ovnnb_schema) self.create_db('ovnnb.db', self.ovnnb_schema)
def start_ovsdb_processes(self): def start_ovsdb_processes(self):
super(OvsOvnVenvFixture, self).start_ovsdb_processes() super().start_ovsdb_processes()
self.call(['ovsdb-server', '--detach', '--no-chdir', '-vconsole:off', self.call(['ovsdb-server', '--detach', '--no-chdir', '-vconsole:off',
'--pidfile=%s' % os.path.join(self.venv, 'ovnnb_db.pid'), '--pidfile=%s' % os.path.join(self.venv, 'ovnnb_db.pid'),
'--log-file=%s' % os.path.join(self.venv, 'ovnnb_db.log'), '--log-file=%s' % os.path.join(self.venv, 'ovnnb_db.log'),
@ -210,7 +210,7 @@ class OvsOvnVenvFixture(OvsVenvFixture):
'--remote=p' + self.ovnsb_connection, 'ovnsb.db']) '--remote=p' + self.ovnsb_connection, 'ovnsb.db'])
def init_processes(self): def init_processes(self):
super(OvsOvnVenvFixture, self).init_processes() super().init_processes()
self.call(['ovn-nbctl', 'init']) self.call(['ovn-nbctl', 'init'])
self.call(['ovn-sbctl', 'init']) self.call(['ovn-sbctl', 'init'])
if self.add_chassis: if self.add_chassis:

View File

@ -8,7 +8,7 @@ coverage!=4.4,>=4.0 # Apache-2.0
isort==4.3.21 # MIT isort==4.3.21 # MIT
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
pylint==2.3.0 # GPLv2 pylint==2.6.0 # GPLv2
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT