Fix invalid escape sequence warnings

Starting with py36, DeprecationWarnings are raised for special
characters in strings that are not being used as valid escape sequences.
This addresses a couple instances we had for string replacement by
changing the replacement strings to be raw strings.

Change-Id: I93291e978aacaf3f639f32174605528f0038f13a
Signed-off-by: Sean McGinnis <>
This commit is contained in:
Sean McGinnis 2019-04-09 16:20:13 -05:00
parent 614b2cb1d5
commit d71c267b9d
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -348,7 +348,7 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector):
ip, port = connection_properties['target_portal'].rsplit(':', 1)
# NOTE(geguileo): I don't know if IPv6 will be reported with []
# or not, so we'll make them optional.
ip = ip.replace('[', '\[?').replace(']', '\]?')
ip = ip.replace('[', r'\[?').replace(']', r'\]?')
out = self._run_iscsiadm_bare(['-m', 'discoverydb',
'-o', 'show',
'-P', 1])[0] or ""