Skip to content

Commit a059ff4

Browse files
twangboydwoz
authored andcommitted
Fix pre-commit
1 parent 3d3d6d6 commit a059ff4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

salt/modules/win_lgpo.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -5060,6 +5060,7 @@ def _remove_invalid_xmlns(xml_file):
50605060
xml_tree = lxml.etree.parse(io.StringIO(modified_xml))
50615061
return xml_tree
50625062

5063+
50635064
def _encode_xmlns_url(match):
50645065
"""
50655066
Escape spaces in xmlns urls
@@ -5068,9 +5069,10 @@ def _encode_xmlns_url(match):
50685069
xmlns = match.group(2)
50695070
url = match.group(3)
50705071
after_url = match.group(4)
5071-
encoded_url = re.sub(r'\s+', '%20', url)
5072+
encoded_url = re.sub(r"\s+", "%20", url)
50725073
return f'{before_xmlns}{xmlns}="{encoded_url}"{after_url}'
50735074

5075+
50745076
def _parse_xml(adm_file):
50755077
"""
50765078
Parse the admx/adml file. There are 3 scenarios (so far) that we'll likely
@@ -5118,7 +5120,11 @@ def _parse_xml(adm_file):
51185120
raw = raw.decode(encoding)
51195121
for line in raw.split("\r\n"):
51205122
if 'xmlns="' in line:
5121-
line = re.sub(r'(.*)(\bxmlns(?::\w+)?)\s*=\s*"([^"]+)"(.*)', _encode_xmlns_url, line)
5123+
line = re.sub(
5124+
r'(.*)(\bxmlns(?::\w+)?)\s*=\s*"([^"]+)"(.*)',
5125+
_encode_xmlns_url,
5126+
line,
5127+
)
51225128
if 'key="' in line:
51235129
start = line.index('key="')
51245130
q1 = line[start:].index('"') + start

0 commit comments

Comments
 (0)