-
Notifications
You must be signed in to change notification settings - Fork 393
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
Add IOS Parser "show vlan internal usage" #796
Conversation
Hi, Add IOS parser "show vlan internal usage" Thanks Mehdi
…l/golden_output1_output.txt
changelog add for 'show vlan internal usage'
Hello, two days ago I added a new parser for IOS "show vlan internal usage" |
Hi, please have you checked my submission for a parser? Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. There are a few things that need to be address in this PR, but overall it's looking pretty good
# ================================================= | ||
# Parser for 'show vlan internal usage' command | ||
# ================================================= | ||
class ShowVlanInternalUsage(ShowVlanInternalUsageSchema): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parser and its schema should be under show_vlan.py
, rather than creating a new file for it. Additionally, for ios
devices which are typically identical to iosxe
devices, we'll usually put the parser under iosxe
and import it into ios
. You can see an example of what I mean in src/genie/libs/parser/ios/show_vlan.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please should I remove the file show_vlan_internal_usage.py and pull directly my change under show_vlan.py?
Key names Co-authored-by: Thomas Ryan <[email protected]>
Suggested change for usage Co-authored-by: Thomas Ryan <[email protected]>
Suggested change Co-authored-by: Thomas Ryan <[email protected]>
Please shoud I continue with this PR or close it and open a new one to move the parser to show_vlan.py under IOSXE? |
Here the contribution with "show vlan internal usage" parser as asked, I moved it to "show_vlan.py" and imported it from IOSXE to IOS
…ctory As asked, I will delet this folder to create one in IOSXE Test
I moved this in "show_vlan.py" and imported it from IOSXE into ISO as asked
I added "show vlan internal usage" parser to "show_vlan.py" file as asked in IOSXE and I imported it into IOS
empty_output_output.txt
Add "golden_output1_expected.py" and "golden_output1_output.txt"
Hello, I addressed all the changes asked for:
|
Hello
Please can you review my PR cause I addressed all the changes according to
your review
Thank you
Le ven. 24 nov. 2023 à 16:08, Thomas Ryan ***@***.***> a
écrit :
… ***@***.**** requested changes on this pull request.
Sorry for the delay. There are a few things that need to be address in
this PR, but overall it's looking pretty good
------------------------------
In src/genie/libs/parser/ios/show_vlan_internal_usage.py
<#796 (comment)>
:
> +import re
+
+# Metaparser
+from genie.metaparser import MetaParser
+from genie.metaparser.util.schemaengine import Any
+
+
+# ====================================================
+# Schema for 'show vlan internal usage' command
+# ====================================================
+class ShowVlanInternalUsageSchema(MetaParser):
+ """Schema for:
+ show vlan internal usage"""
+
+ schema = {
+ 'Internal Vlan': {
Key names should all be lowercase with spaces replaced by underscores
⬇️ Suggested change
- 'Internal Vlan': {
+ 'internal_vlan': {
------------------------------
In src/genie/libs/parser/ios/show_vlan_internal_usage.py
<#796 (comment)>
:
> +# Metaparser
+from genie.metaparser import MetaParser
+from genie.metaparser.util.schemaengine import Any
+
+
+# ====================================================
+# Schema for 'show vlan internal usage' command
+# ====================================================
+class ShowVlanInternalUsageSchema(MetaParser):
+ """Schema for:
+ show vlan internal usage"""
+
+ schema = {
+ 'Internal Vlan': {
+ Any(): {
+ 'Usage': str,
⬇️ Suggested change
- 'Usage': str,
+ 'usage': str,
------------------------------
In src/genie/libs/parser/ios/show_vlan_internal_usage.py
<#796 (comment)>
:
> +class ShowVlanInternalUsageSchema(MetaParser):
+ """Schema for:
+ show vlan internal usage"""
+
+ schema = {
+ 'Internal Vlan': {
+ Any(): {
+ 'Usage': str,
+ },
+ }
+ }
+
+# =================================================
+# Parser for 'show vlan internal usage' command
+# =================================================
+class ShowVlanInternalUsage(ShowVlanInternalUsageSchema):
This parser and its schema should be under show_vlan.py, rather than
creating a new file for it. Additionally, for ios devices which are
typically identical to iosxe devices, we'll usually put the parser under
iosxe and import it into ios. You can see an example of what I mean in
src/genie/libs/parser/ios/show_vlan.py
------------------------------
In src/genie/libs/parser/ios/show_vlan_internal_usage.py
<#796 (comment)>
:
> + internal_vlan_dict=parsed_dict.setdefault('Internal Vlan', {})
+ Usage=m.groupdict()['Usage']
+ VLAN=m.groupdict()['VLAN']
+ internal_vlan_dict[VLAN] = {}
+ internal_vlan_dict[VLAN]['Usage']=Usage
Just a bit of cleaning up
⬇️ Suggested change
- internal_vlan_dict=parsed_dict.setdefault('Internal Vlan', {})
- Usage=m.groupdict()['Usage']
- VLAN=m.groupdict()['VLAN']
- internal_vlan_dict[VLAN] = {}
- internal_vlan_dict[VLAN]['Usage']=Usage
+ internal_vlan_dict = parsed_dict.setdefault('internal_vlan', {})
+ usage = m.groupdict()['Usage']
+ vlan = m.groupdict()['VLAN']
+ vlan_dict = internal_vlan_dict[vlan].set_default(vlan, {})
+ vlan_dict['usage'] = usage
—
Reply to this email directly, view it on GitHub
<#796 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARSLWN67QSL6AWPDNKYPCIDYGCZ5NAVCNFSM6AAAAAA6ZXKTRGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONBYGA4TGOJSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hello,
Thank you for reviewing and accepting my changes. Please see "Changes
approved" by 02 reviewers,"All checks have passed" and "This branch has no
conflicts with the base branch". Please, does this mean my parser has
merged or this needs to be granted by the third reviewer?
Thank you
Le mar. 28 nov. 2023 à 17:32, Mehdi CHERIFI ***@***.***> a
écrit :
… Hello
Please can you review my PR cause I addressed all the changes according to
your review
Thank you
Le ven. 24 nov. 2023 à 16:08, Thomas Ryan ***@***.***> a
écrit :
> ***@***.**** requested changes on this pull request.
>
> Sorry for the delay. There are a few things that need to be address in
> this PR, but overall it's looking pretty good
> ------------------------------
>
> In src/genie/libs/parser/ios/show_vlan_internal_usage.py
> <#796 (comment)>
> :
>
> > +import re
> +
> +# Metaparser
> +from genie.metaparser import MetaParser
> +from genie.metaparser.util.schemaengine import Any
> +
> +
> +# ====================================================
> +# Schema for 'show vlan internal usage' command
> +# ====================================================
> +class ShowVlanInternalUsageSchema(MetaParser):
> + """Schema for:
> + show vlan internal usage"""
> +
> + schema = {
> + 'Internal Vlan': {
>
> Key names should all be lowercase with spaces replaced by underscores
> ⬇️ Suggested change
>
> - 'Internal Vlan': {
> + 'internal_vlan': {
>
> ------------------------------
>
> In src/genie/libs/parser/ios/show_vlan_internal_usage.py
> <#796 (comment)>
> :
>
> > +# Metaparser
> +from genie.metaparser import MetaParser
> +from genie.metaparser.util.schemaengine import Any
> +
> +
> +# ====================================================
> +# Schema for 'show vlan internal usage' command
> +# ====================================================
> +class ShowVlanInternalUsageSchema(MetaParser):
> + """Schema for:
> + show vlan internal usage"""
> +
> + schema = {
> + 'Internal Vlan': {
> + Any(): {
> + 'Usage': str,
>
> ⬇️ Suggested change
>
> - 'Usage': str,
> + 'usage': str,
>
> ------------------------------
>
> In src/genie/libs/parser/ios/show_vlan_internal_usage.py
> <#796 (comment)>
> :
>
> > +class ShowVlanInternalUsageSchema(MetaParser):
> + """Schema for:
> + show vlan internal usage"""
> +
> + schema = {
> + 'Internal Vlan': {
> + Any(): {
> + 'Usage': str,
> + },
> + }
> + }
> +
> +# =================================================
> +# Parser for 'show vlan internal usage' command
> +# =================================================
> +class ShowVlanInternalUsage(ShowVlanInternalUsageSchema):
>
> This parser and its schema should be under show_vlan.py, rather than
> creating a new file for it. Additionally, for ios devices which are
> typically identical to iosxe devices, we'll usually put the parser under
> iosxe and import it into ios. You can see an example of what I mean in
> src/genie/libs/parser/ios/show_vlan.py
> ------------------------------
>
> In src/genie/libs/parser/ios/show_vlan_internal_usage.py
> <#796 (comment)>
> :
>
> > + internal_vlan_dict=parsed_dict.setdefault('Internal Vlan', {})
> + Usage=m.groupdict()['Usage']
> + VLAN=m.groupdict()['VLAN']
> + internal_vlan_dict[VLAN] = {}
> + internal_vlan_dict[VLAN]['Usage']=Usage
>
> Just a bit of cleaning up
> ⬇️ Suggested change
>
> - internal_vlan_dict=parsed_dict.setdefault('Internal Vlan', {})
> - Usage=m.groupdict()['Usage']
> - VLAN=m.groupdict()['VLAN']
> - internal_vlan_dict[VLAN] = {}
> - internal_vlan_dict[VLAN]['Usage']=Usage
> + internal_vlan_dict = parsed_dict.setdefault('internal_vlan', {})
> + usage = m.groupdict()['Usage']
> + vlan = m.groupdict()['VLAN']
> + vlan_dict = internal_vlan_dict[vlan].set_default(vlan, {})
> + vlan_dict['usage'] = usage
>
> —
> Reply to this email directly, view it on GitHub
> <#796 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARSLWN67QSL6AWPDNKYPCIDYGCZ5NAVCNFSM6AAAAAA6ZXKTRGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONBYGA4TGOJSGQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
The merge is supposed to be done by pyATS team after having 2 approvals. @ThomasJRyan or @Lelor please merge if no issue for merging. |
Hi @ThomasJRyan @Lelor @sowmyadn010501 Does merging take time after changes approved by two reviewers and all test pass with no conflict with the base branch? Thank you |
@ThomasJRyan Thank you for merging my contribution, and thanks to @Lelor @tahigash |
Description
New IOS/IOSXE Parser "show vlan internal usage"
Motivation and Context
I noticed that there is no parser for "show vlan internal usage" and this contribution will help network engineer
Impact (If any)
Screenshots:
Testing ShowVlanInternalUsage class:
Testing ShowVlanInternalUsage_iosxe class:
Testing the "show vlan internal usage" parser:
Checklist: