Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def expand(self, obj = None):
#find the variables used
template_var_map = {}

for template_var in re.findall('{%\s+(.+?)\s+%\}', obj_str):
for template_var in re.findall(r'{%\s+(.+?)\s+%\}', obj_str):
template_var = template_var.strip()
if template_var_map.get(template_var):
continue
Expand Down Expand Up @@ -99,7 +99,7 @@ def _bracket_ipv6_url(self, json_str):
IPv6_re = "{}:(".format(G)+IPv6_re+"|{})".format(_)

IPv6_re = ":(:" + G + "){0,5}((:" + G + "){1,2}|:" + IPv4 + ")|" + IPv6_re
IPv6_re = re.sub('\(', '(?:', IPv6_re)
IPv6_re = re.sub(r'\(', '(?:', IPv6_re)
json_str = re.sub('(https?)://'+'('+IPv6_re+')', r'\g<1>://[\g<2>]', json_str)

return json_str
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def __init__(self, **kwargs):
self.flip = kwargs.get('flip', False)

def _expand_var(self, template_var):
addr_match = re.match('^address\[(\d+)\]$', template_var)
pscheduler_address_match = re.match('^pscheduler_address\[(\d+)\]$', template_var)
lead_bind_address_match = re.match('^lead_bind_address\[(\d+)\]$', template_var)
jq_match = re.match('^jq (.+)$', template_var)
addr_match = re.match(r'^address\[(\d+)\]$', template_var)
pscheduler_address_match = re.match(r'^pscheduler_address\[(\d+)\]$', template_var)
lead_bind_address_match = re.match(r'^lead_bind_address\[(\d+)\]$', template_var)
jq_match = re.match(r'^jq (.+)$', template_var)

if addr_match:
val = self._parse_group_address(int(addr_match.group(1)))
Expand Down Expand Up @@ -111,4 +111,3 @@ def _parse_localhost(self):

#otherwise use localhost
return 'localhost'

2 changes: 1 addition & 1 deletion psconfig/perfsonar-psconfig/psconfig/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def build_err_msg(http_response):
def extract_url_uuid(url):
url = url.strip()
url = url.strip('"')
# pattern = re.compile('([0-9a-zA-Z\-]+)$')
# pattern = re.compile(r'([0-9a-zA-Z\-]+)$')
# Raw string for a standard UUID v4 pattern:
# 8-4-4-4-12 hex digits, with hyphens
pattern = re.compile(
Expand Down
2 changes: 1 addition & 1 deletion psconfig/perfsonar-psconfig/psconfig/utilities/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def run_metrics(self, guid_match='.+?'):
stats.end = run_end_match.group(1)
stats.pid = run_end_match.group(2)
stats.guid = run_end_match.group(3)
run_start_regex = re.compile(f'^(.+) INFO pid={stats.pid} prog=.+? line=.+? guid={stats.guid} msg=Running agent\.\.\.$')
run_start_regex = re.compile(f'^(.+) INFO pid={stats.pid} prog=.+? line=.+? guid={stats.guid} msg=Running agent\\.\\.\\.$')

#Check if we found a guid, return if not
if stats.guid is None:
Expand Down
Loading