Revert "Lint: W605 invalid escape sequence '\$'"

This reverts commit 76b1cafdcc.
This commit is contained in:
Joshua Boniface 2020-11-07 17:38:03 -05:00
parent d37e5a0c0b
commit f33398458e
5 changed files with 11 additions and 11 deletions

View File

@ -74,7 +74,7 @@ def list_ova(limit, is_fuzzy=True):
limit = '%' + limit limit = '%' + limit
else: else:
limit = limit[1:] limit = limit[1:]
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '%' limit = limit + '%'
else: else:
limit = limit[:-1] limit = limit[:-1]

View File

@ -110,7 +110,7 @@ def list_template(limit, table, is_fuzzy=True):
limit = '%' + limit limit = '%' + limit
else: else:
limit = limit[1:] limit = limit[1:]
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '%' limit = limit + '%'
else: else:
limit = limit[:-1] limit = limit[:-1]
@ -610,7 +610,7 @@ def list_userdata(limit, is_fuzzy=True):
limit = '%' + limit limit = '%' + limit
else: else:
limit = limit[1:] limit = limit[1:]
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '%' limit = limit + '%'
else: else:
limit = limit[:-1] limit = limit[:-1]
@ -705,7 +705,7 @@ def list_script(limit, is_fuzzy=True):
limit = '%' + limit limit = '%' + limit
else: else:
limit = limit[1:] limit = limit[1:]
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '%' limit = limit + '%'
else: else:
limit = limit[:-1] limit = limit[:-1]
@ -800,7 +800,7 @@ def list_profile(limit, is_fuzzy=True):
limit = '%' + limit limit = '%' + limit
else: else:
limit = limit[1:] limit = limit[1:]
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '%' limit = limit + '%'
else: else:
limit = limit[:-1] limit = limit[:-1]

View File

@ -324,7 +324,7 @@ def get_list_osd(zk_conn, limit, is_fuzzy=True):
# Implicitly assume fuzzy limits # Implicitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
for osd in full_osd_list: for osd in full_osd_list:
@ -660,7 +660,7 @@ def get_list_volume(zk_conn, pool, limit, is_fuzzy=True):
# Implicitly assume fuzzy limits # Implicitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
for volume in full_volume_list: for volume in full_volume_list:
@ -766,7 +766,7 @@ def get_list_snapshot(zk_conn, pool, volume, limit, is_fuzzy=True):
# Implicitly assume fuzzy limits # Implicitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
for snapshot in full_snapshot_list: for snapshot in full_snapshot_list:

View File

@ -576,7 +576,7 @@ def get_list_dhcp(zk_conn, network, limit, only_static=False, is_fuzzy=True):
# Implcitly assume fuzzy limits # Implcitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
except Exception as e: except Exception as e:
return False, 'Regex Error: {}'.format(e) return False, 'Regex Error: {}'.format(e)
@ -622,7 +622,7 @@ def get_list_acl(zk_conn, network, limit, direction, is_fuzzy=True):
# Implcitly assume fuzzy limits # Implcitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
except Exception as e: except Exception as e:
return False, 'Regex Error: {}'.format(e) return False, 'Regex Error: {}'.format(e)

View File

@ -691,7 +691,7 @@ def get_list(zk_conn, node, state, limit, is_fuzzy=True):
# Implcitly assume fuzzy limits # Implcitly assume fuzzy limits
if not re.match('[^].*', limit): if not re.match('[^].*', limit):
limit = '.*' + limit limit = '.*' + limit
if not re.match('.*[$]', limit): if not re.match('.*\$', limit):
limit = limit + '.*' limit = limit + '.*'
except Exception as e: except Exception as e:
return False, 'Regex Error: {}'.format(e) return False, 'Regex Error: {}'.format(e)