def get_root_helper(conf):
root_helper = conf.AGENT.root_helper
- if root_helper is not 'sudo':
+ if root_helper != 'sudo':
return root_helper
root_helper = conf.root_helper
- if root_helper is not 'sudo':
+ if root_helper != 'sudo':
LOG.deprecated(_('DEFAULT.root_helper is deprecated! Please move '
'root_helper configuration to [AGENT] section.'))
return root_helper
"resource: %s"), resource)
if 'status' in resource:
- if resource['status'] is not const.NET_STATUS_ACTIVE:
+ if resource['status'] != const.NET_STATUS_ACTIVE:
LOG.warning(_("Operational status is internally set by the "
"plugin. Ignoring setting status=%s."),
resource['status'])
self.root_helper = root_helper
self.setup_linux_bridge(interface_mappings)
configurations = {'interface_mappings': interface_mappings}
- if self.br_mgr.vxlan_mode is not lconst.VXLAN_NONE:
+ if self.br_mgr.vxlan_mode != lconst.VXLAN_NONE:
configurations['tunneling_ip'] = self.br_mgr.local_ip
configurations['tunnel_types'] = [p_const.TYPE_VXLAN]
configurations['l2_population'] = cfg.CONF.VXLAN.l2_population
LOG.error(_("create_ofc_port() failed due to %s"), exc)
port_status = const.PORT_STATUS_ERROR
- if port_status is not port['status']:
+ if port_status != port['status']:
self._update_resource_status(context, "port", port['id'],
port_status)
port['status'] = port_status
LOG.error(_("delete_ofc_port() failed due to %s"), exc)
port_status = const.PORT_STATUS_ERROR
- if port_status is not port['status']:
+ if port_status != port['status']:
self._update_resource_status(context, "port", port['id'],
port_status)
port['status'] = port_status
network)
self._process_l3_update(context, new_net, network['network'])
- changed = (old_net['admin_state_up'] is not new_net['admin_state_up'])
+ changed = (old_net['admin_state_up'] != new_net['admin_state_up'])
if changed and not new_net['admin_state_up']:
# disable all active ports of the network
filters = dict(network_id=[id], status=[const.PORT_STATUS_ACTIVE])
# Port security/IP was updated off. Need to check that no security
# groups are on port.
- if (ret_port[psec.PORTSECURITY] is not True or not has_ip):
+ if (ret_port[psec.PORTSECURITY] != True or not has_ip):
if has_security_groups:
raise psec.PortSecurityAndIPRequiredForSecurityGroups()