Open
Description
Environment
- Python version: 3.12
- netutils version: 1.12.0
Expected Behavior
uptime_string_to_seconds("2w1d")
would result in an integer of the number of seconds.
Observed Behavior
ValueError: Unable to parse uptime string.
Steps to Reproduce
- In a Python shell,
from netutils.time import uptime_string_to_seconds
- Call function with a string argument that does not contain a seconds value (such as
"2w1d"
) - Observe exception
The closest matching regex parser assumes every uptime string will contain a 'seconds' value, which isn't always true. For example; in the up-time
attribute of a NETCONF query to a Cisco IOS-XE device to show BGP neighbors.
Metadata
Metadata
Assignees
Labels
No labels