Merge "ovsdb: Move constants outside the class"

This commit is contained in:
Zuul 2017-12-03 10:53:53 +00:00 committed by Gerrit Code Review
commit f22a9e3afc
1 changed files with 8 additions and 4 deletions

View File

@ -65,19 +65,23 @@ ovsdb_monitor_table_filter_default = {
]
}
_HANDLED_INTERFACE_TYPES = (
constants.OVS_VM_INTERFACE,
constants.OVS_TUNNEL_INTERFACE,
constants.OVS_BRIDGE_INTERFACE,
)
class DFIdl(idl.Idl):
def __init__(self, nb_api, remote, schema):
super(DFIdl, self).__init__(remote, schema)
self.nb_api = nb_api
self.interface_type = (constants.OVS_VM_INTERFACE,
constants.OVS_TUNNEL_INTERFACE,
constants.OVS_BRIDGE_INTERFACE)
def _is_handle_interface_update(self, interface):
if interface.name == cfg.CONF.df_metadata.metadata_interface:
return True
if interface.type not in self.interface_type:
if interface.type not in _HANDLED_INTERFACE_TYPES:
return False
if interface.name.startswith('qg'):
return False