Fix invalid string escape sequences.

This commit is contained in:
Matt Clay 2017-11-21 10:24:37 -08:00
parent 6ac9d05de6
commit 9735a70059
49 changed files with 81 additions and 81 deletions

View file

@ -271,8 +271,8 @@ except ImportError:
from ansible.module_utils.basic import AnsibleModule
NAME_RE = '({0}|{0}{1}*{0})'.format('[a-zA-Z0-9]', '[a-zA-Z0-9\-]')
HOSTNAME_RE = '({0}\.)*{0}$'.format(NAME_RE)
NAME_RE = r'({0}|{0}{1}*{0})'.format(r'[a-zA-Z0-9]', r'[a-zA-Z0-9\-]')
HOSTNAME_RE = r'({0}\.)*{0}$'.format(NAME_RE)
MAX_DEVICES = 100
PACKET_DEVICE_STATES = (
@ -403,7 +403,7 @@ def get_hostname_list(module):
if (len(hostnames) == 1) and (count > 0):
hostname_spec = hostnames[0]
count_range = range(count_offset, count_offset + count)
if re.search("%\d{0,2}d", hostname_spec):
if re.search(r"%\d{0,2}d", hostname_spec):
hostnames = [hostname_spec % i for i in count_range]
elif count > 1:
hostname_spec = '%s%%02d' % hostname_spec