diff --git a/ironic/api/controllers/v1/types.py b/ironic/api/controllers/v1/types.py index d64ba47bb3..87f5749540 100644 --- a/ironic/api/controllers/v1/types.py +++ b/ironic/api/controllers/v1/types.py @@ -192,7 +192,7 @@ jsontype = JsonType() class JsonPatchType(wtypes.Base): """A complex type that represents a single json-patch operation.""" - path = wtypes.wsattr(wtypes.StringType(pattern='^(/[\w-]+)+$'), + path = wtypes.wsattr(wtypes.StringType(pattern='^(/[\\w-]+)+$'), mandatory=True) op = wtypes.wsattr(wtypes.Enum(str, 'add', 'replace', 'remove'), mandatory=True) diff --git a/ironic/api/middleware/auth_token.py b/ironic/api/middleware/auth_token.py index ff81b0dfe0..1f7500c0a9 100644 --- a/ironic/api/middleware/auth_token.py +++ b/ironic/api/middleware/auth_token.py @@ -33,7 +33,7 @@ class AuthTokenMiddleware(auth_token.AuthProtocol): self._ironic_app = app # TODO(mrda): Remove .xml and ensure that doesn't result in a # 401 Authentication Required instead of 404 Not Found - route_pattern_tpl = '%s(\.json|\.xml)?$' + route_pattern_tpl = '%s(\\.json|\\.xml)?$' try: self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl) diff --git a/ironic/common/utils.py b/ironic/common/utils.py index 9fcc5f48e4..acde43b6e4 100644 --- a/ironic/common/utils.py +++ b/ironic/common/utils.py @@ -153,7 +153,7 @@ def is_valid_no_proxy(no_proxy): """ if not isinstance(no_proxy, six.string_types): return False - hostname_re = re.compile('(?!-)[A-Z\d-]{1,63}(?