Skip to content

"show authentication sessions" returns "Parser Output is empty" when "No sessions currently exist" cli output is returned from device. #930

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

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

czinu
Copy link
Contributor

@czinu czinu commented Feb 23, 2025

Description

When there are no authentication sessions, this is when CLI outputs:

access-switch-01#show authentication sessions
No sessions currently exist

Unable to parse output for command 'show authentication sesssions" (Parser Output is empty) error is returned.

Motivation and Context

Return proper response when authentication service is not enabled or there are currently no active sessions.

{
    "interfaces": {

    },
    "session_count": 0
}

Ansible failed run:

fatal: [access-switch-01]: FAILED! =>
  msg: Unable to parse output for command 'show authentication sessions' (Parser Output is empty)

Ansible successful run:

ok: [access-switch-01] =>
  msg:
    show_authentication_sessions:
      interfaces: {}
      session_count: 0

…hen there are no authentication sessions eg. either authentication service is not enabled or there are currently no sessions available.
@czinu czinu requested a review from a team as a code owner February 23, 2025 17:48
@czinu czinu requested review from ThomasJRyan and Taarini February 23, 2025 17:48
@czinu czinu changed the title "show authentication sessions" returns "Parser Output is empty" when "No sessions currently exist" "show authentication sessions" returns "Parser Output is empty" when "No sessions currently exist" cli output is returned from device. Feb 23, 2025
Copy link
Collaborator

@ThomasJRyan ThomasJRyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we do appreciate the contribution, it does kind of go against how we prefer to structure our parsers. The error you're encountering is intended. Is there perhaps a middle ground we can reach?

@Taarini Taarini merged commit b262cd2 into CiscoTestAutomation:main Feb 24, 2025
4 checks passed
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.

3 participants