From 3ed97d209fe8139ea8c3345e9b411d351be856db Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 7 Nov 2020 17:39:34 -0500 Subject: [PATCH] Revert "Lint: W605 invalid escape sequence '\^'" This reverts commit 639937f9c2be4de57d74380072be4262fde93220. --- api-daemon/pvcapid/ova.py | 2 +- api-daemon/pvcapid/provisioner.py | 8 ++++---- client-cli/pvc.py | 6 +++--- daemon-common/ceph.py | 6 +++--- daemon-common/network.py | 4 ++-- daemon-common/vm.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api-daemon/pvcapid/ova.py b/api-daemon/pvcapid/ova.py index e1e30a5d..af48c19f 100755 --- a/api-daemon/pvcapid/ova.py +++ b/api-daemon/pvcapid/ova.py @@ -70,7 +70,7 @@ def list_ova(limit, is_fuzzy=True): if limit: if is_fuzzy: # Handle fuzzy vs. non-fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '%' + limit else: limit = limit[1:] diff --git a/api-daemon/pvcapid/provisioner.py b/api-daemon/pvcapid/provisioner.py index df7adbfd..095fa989 100755 --- a/api-daemon/pvcapid/provisioner.py +++ b/api-daemon/pvcapid/provisioner.py @@ -106,7 +106,7 @@ def list_template(limit, table, is_fuzzy=True): if limit: if is_fuzzy: # Handle fuzzy vs. non-fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '%' + limit else: limit = limit[1:] @@ -606,7 +606,7 @@ def list_userdata(limit, is_fuzzy=True): if limit: if is_fuzzy: # Handle fuzzy vs. non-fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '%' + limit else: limit = limit[1:] @@ -701,7 +701,7 @@ def list_script(limit, is_fuzzy=True): if limit: if is_fuzzy: # Handle fuzzy vs. non-fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '%' + limit else: limit = limit[1:] @@ -796,7 +796,7 @@ def list_profile(limit, is_fuzzy=True): if limit: if is_fuzzy: # Handle fuzzy vs. non-fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '%' + limit else: limit = limit[1:] diff --git a/client-cli/pvc.py b/client-cli/pvc.py index 4135859e..22bf492d 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -737,7 +737,7 @@ def vm_modify(domain, cfgfile, editor, restart): click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) elif re.match('^\-', line) is not None: click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) - elif re.match('^[^]', line) is not None: + elif re.match('^\^', line) is not None: click.echo(colorama.Fore.BLUE + line + colorama.Fore.RESET) else: click.echo(line) @@ -3043,7 +3043,7 @@ def provisioner_userdata_modify(name, filename, editor): click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) elif re.match('^\-', line) is not None: click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) - elif re.match('^[^]', line) is not None: + elif re.match('^\^', line) is not None: click.echo(colorama.Fore.BLUE + line + colorama.Fore.RESET) else: click.echo(line) @@ -3228,7 +3228,7 @@ def provisioner_script_modify(name, filename, editor): click.echo(colorama.Fore.GREEN + line + colorama.Fore.RESET) elif re.match('^\-', line) is not None: click.echo(colorama.Fore.RED + line + colorama.Fore.RESET) - elif re.match('^[^]', line) is not None: + elif re.match('^\^', line) is not None: click.echo(colorama.Fore.BLUE + line + colorama.Fore.RESET) else: click.echo(line) diff --git a/daemon-common/ceph.py b/daemon-common/ceph.py index 54035dc7..73fa32d4 100644 --- a/daemon-common/ceph.py +++ b/daemon-common/ceph.py @@ -322,7 +322,7 @@ def get_list_osd(zk_conn, limit, is_fuzzy=True): if is_fuzzy and limit: # Implicitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*' @@ -658,7 +658,7 @@ def get_list_volume(zk_conn, pool, limit, is_fuzzy=True): limit = '^' + limit + '$' else: # Implicitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*' @@ -764,7 +764,7 @@ def get_list_snapshot(zk_conn, pool, volume, limit, is_fuzzy=True): if is_fuzzy and limit: # Implicitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*' diff --git a/daemon-common/network.py b/daemon-common/network.py index 75e19745..a727c53a 100644 --- a/daemon-common/network.py +++ b/daemon-common/network.py @@ -574,7 +574,7 @@ def get_list_dhcp(zk_conn, network, limit, only_static=False, is_fuzzy=True): limit = '^' + limit + '$' # Implcitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*' @@ -620,7 +620,7 @@ def get_list_acl(zk_conn, network, limit, direction, is_fuzzy=True): limit = '^' + limit + '$' # Implcitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*' diff --git a/daemon-common/vm.py b/daemon-common/vm.py index 1a67d2e2..6d948a4d 100644 --- a/daemon-common/vm.py +++ b/daemon-common/vm.py @@ -689,7 +689,7 @@ def get_list(zk_conn, node, state, limit, is_fuzzy=True): if limit and is_fuzzy: try: # Implcitly assume fuzzy limits - if not re.match('[^].*', limit): + if not re.match('\^.*', limit): limit = '.*' + limit if not re.match('.*\$', limit): limit = limit + '.*'