-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uptime string fails parsing if missing seconds #615
Comments
Can you provide the perceived rules you see in Should be super simple to update regex to include it here once understood: netutils/netutils/constants.py Lines 406 to 420 in 547c342
|
That's a good question. I'll comb through some more outputs to see if there's a "rollover" that happens where seconds are no longer included. Also can we talk about how a structured data API like NETCONF is still providing a human readable timestamp instead of a raw number value or other machine-friendly timestamp? 😞 |
Environment
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
from netutils.time import uptime_string_to_seconds
"2w1d"
)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.The text was updated successfully, but these errors were encountered: