not-callable,
no-value-for-parameter,
super-on-old-class,
- too-few-format-args,
# "W" Warnings for stylistic problems or minor programming issues
abstract-method,
- anomalous-backslash-in-string,
- anomalous-unicode-escape-in-string,
arguments-differ,
attribute-defined-outside-init,
bad-builtin,
class IpLinkSupport(object):
- VF_BLOCK_REGEX = "\[ vf NUM(?P<vf_block>.*) \] \]"
+ VF_BLOCK_REGEX = r"\[ vf NUM(?P<vf_block>.*) \] \]"
- CAPABILITY_REGEX = "\[ %s (.*)"
- SUB_CAPABILITY_REGEX = "\[ %(cap)s (.*) \[ %(subcap)s (.*)"
+ CAPABILITY_REGEX = r"\[ %s (.*)"
+ SUB_CAPABILITY_REGEX = r"\[ %(cap)s (.*) \[ %(subcap)s (.*)"
@classmethod
def get_vf_mgmt_section(cls, root_helper=None):
def _validate_no_whitespace(data):
"""Validates that input has no whitespace."""
- if re.search('\s', data):
+ if re.search(r'\s', data):
msg = _("'%s' contains whitespace") % data
LOG.debug(msg)
raise n_exc.InvalidInput(error_message=msg)
'expected_codes': {'allow_post': True, 'allow_put': True,
'validate': {
'type:regex':
- '^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$'},
+ r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$'},
'default': '200',
'is_visible': True},
'admin_state_up': {'allow_post': True, 'allow_put': True,
'allow_post': True,
'allow_put': True,
'validate': {
- 'type:regex': '^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$'
+ 'type:regex': r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$'
},
'default': '200',
'is_visible': True
return result.rowcount != 0
def _get_lock_owner(self, record):
- matches = re.findall("^LOCKED_BY\[(\w+)\]", record)
+ matches = re.findall(r"^LOCKED_BY\[(\w+)\]", record)
if not matches:
return None
return matches[0]
def create_bridge(self, **kwargs):
"""Create a new bridge
- :param \**kwargs: configuration of the new bridge
+ :param kwargs: configuration of the new bridge
:returns: newly created bridge
"""
LOG.debug("MidoClient.create_bridge called: "
"""Update a bridge of the given id with the new fields
:param id: id of the bridge
- :param \**kwargs: the fields to update and their values
+ :param kwargs: the fields to update and their values
:returns: bridge object
"""
LOG.debug("MidoClient.update_bridge called: "
"""Add a port on a bridge
:param bridge: bridge to add a new port to
- :param \**kwargs: configuration of the new port
+ :param kwargs: configuration of the new port
:returns: newly created port
"""
LOG.debug("MidoClient.add_bridge_port called: "
"""Update a port of the given id with the new fields
:param id: id of the port
- :param \**kwargs: the fields to update and their values
+ :param kwargs: the fields to update and their values
"""
LOG.debug("MidoClient.update_port called: "
"id=%(id)s, kwargs=%(kwargs)s",
"""Add a new port to an existing router.
:param router: router to add a new port to
- :param \**kwargs: configuration of the new port
+ :param kwargs: configuration of the new port
:returns: newly created port
"""
return self._create_dto(self.mido_api.add_router_port(router), kwargs)
def create_router(self, **kwargs):
"""Create a new router
- :param \**kwargs: configuration of the new router
+ :param kwargs: configuration of the new router
:returns: newly created router
"""
LOG.debug("MidoClient.create_router called: "
"""Update a router of the given id with the new name
:param id: id of the router
- :param \**kwargs: the fields to update and their values
+ :param kwargs: the fields to update and their values
:returns: router object
"""
LOG.debug("MidoClient.update_router called: "
from neutron import service
ACI_PORT_DESCR_FORMATS = [
- 'topology/pod-1/node-(\d+)/sys/conng/path-\[eth(\d+)/(\d+)\]',
- 'topology/pod-1/paths-(\d+)/pathep-\[eth(\d+)/(\d+)\]',
+ r'topology/pod-1/node-(\d+)/sys/conng/path-\[eth(\d+)/(\d+)\]',
+ r'topology/pod-1/paths-(\d+)/pathep-\[eth(\d+)/(\d+)\]',
]
AGENT_FORCE_UPDATE_COUNT = 100
BINARY_APIC_SERVICE_AGENT = 'neutron-cisco-apic-service-agent'
DEVICE_PATH = "/sys/class/net/%s/device"
PCI_PATH = "/sys/class/net/%s/device/virtfn%s/net"
- VIRTFN_FORMAT = "^virtfn(?P<vf_index>\d+)"
+ VIRTFN_FORMAT = r"^virtfn(?P<vf_index>\d+)"
VIRTFN_REG_EX = re.compile(VIRTFN_FORMAT)
MAC_VTAP_PREFIX = "upper_macvtap*"
def __init__(self, kind, match):
# Process the match
try:
- self.target_field = re.findall('^\%\((.*)\)s$',
+ self.target_field = re.findall(r'^\%\((.*)\)s$',
match)[0]
except IndexError:
err_reason = (_("Unable to identify a target field from:%s."