genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

[IOS-XE] Support of SSID with space

Open FlavienJP opened this issue 11 months ago • 6 comments

Hello,

We are using Genie in conjonction with PyATS for testing, but we saw that Genie was unable to work with SSID that is using space within it.

We have made some changes to our local library that has corrected the genie behaviour to support this configuration.

class ShowWlanSummary(ShowWlanSummarySchema):

https://github.com/CiscoTestAutomation/genieparser/blob/89d5b1cab1a0bd6cdedef9b3ab6352b9d1006655/src/genie/libs/parser/iosxe/show_wlan.py#L63

Before : ^(?P<wlan_id>\d+)\s+(?P<profile_name>\S+)\s+(?P<ssid>\S+)\s+(?P<wlan_status>\S+)\s+(?P<status_security>.*$)

After : ^(?P<wlan_id>\d+)\s+(?P<profile_name>\S+)\s+(?P<ssid>.*?)(?:\s{2,})\s+(?P<wlan_status>\S+)\s+(?P<status_security>.*$)

This enhance the SSID support with maxmium 2 following spaces in the title (in my opinion, 1 is enough).

class ShowWlanAllSchema(MetaParser):

https://github.com/CiscoTestAutomation/genieparser/blob/89d5b1cab1a0bd6cdedef9b3ab6352b9d1006655/src/genie/libs/parser/iosxe/show_wlan.py#L140

Before : "radio_policy": str,

After : Optional("radio_policy"): str,

Base on our testings, the radio policy is not visible in the CLI extract when using DNAC, it's preferable to mark it as optional.

class ShowWlanAll(ShowWlanAllSchema):

https://github.com/CiscoTestAutomation/genieparser/blob/89d5b1cab1a0bd6cdedef9b3ab6352b9d1006655/src/genie/libs/parser/iosxe/show_wlan.py#L396

Before : p_name_ssid = re.compile(r"^Network\s+Name\s+\(SSID\)\s+:\s+(?P<value>\S+)$")

After : p_name_ssid = re.compile(r"^Network\s+Name\s+\(SSID\)\s+:\s+(?P<value>.*)$")

Then end of the line is containing the SSID (no more information) so we can add .* to catch everything.

FlavienJP avatar Mar 25 '24 12:03 FlavienJP

Hello ,

Can you please share me the outputs of two command show wlan summary and show wlan all.

ParimiNeeraja avatar Mar 26 '24 13:03 ParimiNeeraja

Hello @ParimiNeeraja,

I can first provide you the summary.

raw = device.execute("show wlan summary")
2024-03-26 17:38:20,677: %UNICON-INFO: +++ demowlc with via 'cli': executing command 'show wlan summary' +++
show wlan summary
Number of WLANs: 2
ID   Profile Name                     SSID                             Status Security                                                                                             
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
17   CUST_Global_NF_6f7f68b3     CUST Administrative                     UP     [WPA2][PSK][AES],MAC Filtering                                                                       
18   CUSTC_Global_NF_24c59b82    CUST Factory                 UP     [WPA2][802.1x][AES]                                                                                  
demowlc#

Regards,

FlavienJP avatar Mar 26 '24 16:03 FlavienJP

Thanks for providing output. Can you please provide the output for show wlan all

Neeraja1bala avatar Mar 27 '24 06:03 Neeraja1bala

Hello @FlavienJP ,

The above PR got approve from reviewers. Kindly merge the PR.

Neeraja1bala avatar Apr 03 '24 10:04 Neeraja1bala

Hello @FlavienJP ,

One reviewer was commented in PR. Please follow up the PR.

Neeraja1bala avatar Apr 04 '24 06:04 Neeraja1bala

Hello @FlavienJP ,

PR got merged. Changes will reflected in next version.

Neeraja1bala avatar Apr 05 '24 16:04 Neeraja1bala