diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-07-23 15:28:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-23 15:28:21 +0100 |
| commit | 3668d1eec819d545ec29bd56a98e22ce4775156e (patch) | |
| tree | e4aae8f07417c51beeaac8539acf152c71e66f82 /python | |
| parent | bf2b506e45b574b18cf8be5dfd2c8e33ac999732 (diff) | |
| parent | f88bbe9f306844b12184c50892ff1634502b03fc (diff) | |
| download | vyos-1x-3668d1eec819d545ec29bd56a98e22ce4775156e.tar.gz vyos-1x-3668d1eec819d545ec29bd56a98e22ce4775156e.zip | |
Merge pull request #5327 from BradKollmyer/T9076-remote-group-interval
firewall: T9076: add per-remote-group update interval
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/utils/convert.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/vyos/utils/convert.py b/python/vyos/utils/convert.py index bdc9fd549..f867b4167 100644 --- a/python/vyos/utils/convert.py +++ b/python/vyos/utils/convert.py @@ -26,10 +26,14 @@ time_units = { def human_to_seconds(time_str): - """ Converts a human-readable interval such as 1w4d18h35m59s - to number of seconds + """Converts a human-readable interval such as 1w4d18h35m59s + to number of seconds. A plain number is taken as seconds. """ + time_str = str(time_str) + if time_str.isdigit(): + return int(time_str) + time_patterns = { 'y': r'(\d+)\s*y', 'w': r'(\d+)\s*w', |
