mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 06:31:23 -07:00
Fix invalid string escape sequences.
This commit is contained in:
parent
6ac9d05de6
commit
9735a70059
49 changed files with 81 additions and 81 deletions
|
@ -287,7 +287,7 @@ def main():
|
|||
age = None
|
||||
else:
|
||||
# convert age to seconds:
|
||||
m = re.match("^(-?\d+)(s|m|h|d|w)?$", params['age'].lower())
|
||||
m = re.match(r"^(-?\d+)(s|m|h|d|w)?$", params['age'].lower())
|
||||
seconds_per_unit = {"s": 1, "m": 60, "h": 3600, "d": 86400, "w": 604800}
|
||||
if m:
|
||||
age = int(m.group(1)) * seconds_per_unit.get(m.group(2), 1)
|
||||
|
@ -298,7 +298,7 @@ def main():
|
|||
size = None
|
||||
else:
|
||||
# convert size to bytes:
|
||||
m = re.match("^(-?\d+)(b|k|m|g|t)?$", params['size'].lower())
|
||||
m = re.match(r"^(-?\d+)(b|k|m|g|t)?$", params['size'].lower())
|
||||
bytes_per_unit = {"b": 1, "k": 1024, "m": 1024**2, "g": 1024**3, "t": 1024**4}
|
||||
if m:
|
||||
size = int(m.group(1)) * bytes_per_unit.get(m.group(2), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue