Skip to content
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

Update to allow more timezone patterns #653

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* IOSXE
* Modified ShowClock:
* Modified regex to allow timezones that use UTC offset (+/-).
8 changes: 4 additions & 4 deletions src/genie/libs/parser/iosxe/show_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ def cli(self, output=None):
# initial regexp pattern
# 05:26:38.035 EST Wed JAN 4 2019
# *05:26:38.035 EST Wed JAN 4 2019
# 05:26:38.035 UTC+2 Wed JAN 4 2019
p1 = re.compile(
r"^\*?(?P<time>[\d\:\.]+) +(?P<timezone>\w+)"
" +(?P<day_of_week>\w+) +(?P<month>\w+) +"
"(?P<day>\d+) +(?P<year>\d+)$"
r"^\*?(?P<time>[\d\:\.]+) +(?P<timezone>\w+([\+\-]\d+)?)"
r" +(?P<day_of_week>\w+) +(?P<month>\w+) +"
r"(?P<day>\d+) +(?P<year>\d+)$"
)

for line in out.splitlines():
Expand Down Expand Up @@ -626,4 +627,3 @@ def yang(self, nonce="", output=None):
elif sub_child2.tag.endswith('version'):
sign_dict.update({'version': int(sub_child2.text)})
return ret_dict