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

Cisco WLC Command - Show 802 11a|b #501

Merged
merged 9 commits into from
Oct 25, 2019
Merged

Cisco WLC Command - Show 802 11a|b #501

merged 9 commits into from
Oct 25, 2019

Conversation

timjsmith24
Copy link
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

cisco_wlc_ssh_show_802_11b.template, .*, cisco_wlc_ssh, show 802.11b

SUMMARY

@jmcgill298
Copy link
Contributor

What do you think of converting repetitive fields into lists? Example:

parsed_sample:
- ac_support: Enabled
  beacon_interval: '100'
  data_rate: ["12m", "18m", "24m", "36m", "48m", "54m", "6m", "9m"]
  data_rate_value: ["Mandatory", "Supported", "Mandatory", " Supported", "Supported", "Supported", "Mandatory", "Supported"]
  edca: default-wmm
  max_client: '200'
  mcs_rate: ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"]
  mcs_rate_value: ["Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported", "Supported"]
  n_support: Enabled
  rssi_low_check: Disabled
  rssi_thres: '-80'
  status: Disabled
  video_amc: Disabled
  video_cac_method: Static
  video_max_bandwidth: '0'
  video_roaming_bandwidth: '0'
  voice_amc: Disabled
  voice_cac_method: Load-Based
  voice_max_bandwidth: '75'
  voice_roaming_bandwidth: '6'

@timjsmith24
Copy link
Contributor Author

I had thought about that, but having them as key:values is helpful when trying to identify which data rates/mcs rates are set to a specific value. Instead of looking up the list index for the value then the using that index in the list of rates. This was the only way I could figure out setting them as key:values.

@jmcgill298
Copy link
Contributor

jmcgill298 commented Oct 23, 2019

We generally post-process TextFSM output, and this would be part of that process. Here is an example of post-processing two corresponding lists.

>>> parsed_sample = [
        {
            'data_rate': ['12m', '18m', '24m', '36m', '48m', '54m', '6m', '9m'],
            'data_rate_value': ['Mandatory', 'Supported', 'Mandatory', 'Supported', 'Supported', 'Supported', 'Mandatory', 'Supported'],
        }
    ]
>>> command_data = parsed_sample[0]
>>> data_rate = command_data["data_rate"]
>>> data_rate_value = command_data["data_rate_value"]
>>> post_processed = {"data_rates": dict(zip(data_rate, data_rate_value))}
>>> post_processed
{
    'data_rates': {
        '12m': 'Mandatory',
        '18m': 'Supported',
        '24m': 'Mandatory',
        '36m': 'Supported',
        '48m': 'Supported',
        '54m': 'Supported',
        '6m': 'Mandatory',
        '9m': 'Supported'
    }
}
>>> 

@timjsmith24 timjsmith24 changed the title Cisco WLC Command - Show 802 11b Cisco WLC Command - Show 802 11a|b Oct 23, 2019
@timjsmith24
Copy link
Contributor Author

Ok so I made lists out of the data rates, mcs rates, and the support specs. This also allowed me to combine the 802.11a and 802.11b commands

@jmcgill298
Copy link
Contributor

@timjsmith24 The command for the index file should escape the ., as this is a regex line so it reads as anything instead of as a literal .. I made this update and that caused an issue with the test files properly testing. I updated the test files and that is working properly. In addition, we require that that each state end with ^. -> Error to ensure each line in the data is accounted for, which gives us confidence that we are accurately parsing the command output. I have also added these to the template, and the tests still pass.

However, I went to make a PR back into your branch, but GitHub is not letting me issue PRs to your fork. Can you check my show_802_11b branch? If you are good with those changes, can you pull them into your branch? Please let me know if you have any questions, or any issues with the changes on my branch.

@timjsmith24
Copy link
Contributor Author

looks good. Thanks!

@jmcgill298 jmcgill298 merged commit b61ded4 into networktocode:master Oct 25, 2019
@timjsmith24 timjsmith24 deleted the show_802_11b branch October 25, 2019 19:25
thomasblass pushed a commit to thomasblass/ntc-templates that referenced this pull request Oct 25, 2020
jvanderaa pushed a commit that referenced this pull request Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants