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.
@@ -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 ""
