8000 Update AAA module with Accounting changes by Divya-N3 · Pull Request #559 · ansible-collections/dellemc.enterprise_sonic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update AAA module with Accounting changes #559

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Divya-N3
Copy link
Contributor
@Divya-N3 Divya-N3 commented May 14, 2025

SUMMARY
Added Accounting support to the AAA module.

ISSUE TYPE

  • Feature Pull Request

COMPONENT NAME
sonic_aaa

OUTPUT
regression-2025-05-14-08-15-00.pdf

Checklist:**

  • I have performed a self-review of my own code to ensure there are no formatting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility or have provided any relevant "breaking_changes" descriptions in a "fragment" file in the "changelogs/fragments" directory of this repository.
  • I have provided a summary for this PR in valid "fragment" file format in the "changelogs/fragments" directory of this repository branch. Reference : Ansible Change Log Document

@@ -39,6 +39,9 @@

AAA_AUTHENTICATION_PATH = '/data/openconfig-system:system/aaa/authentication/config'
AAA_AUTHORIZATION_PATH = '/data/openconfig-system:system/aaa/authorization'
AAA_COMMANDS_ACCOUNTING_PATH = '/data/openconfig-system:system/aaa/accounting/openconfig-system-ext:commands/config'
AAA_SESSION_ACCOUNTING_PATH = '/data/openconfig-system:system/aaa/accounting/openconfig-system-ext:session/config'
AA_AUTHORIZATION_PATH = '/data/openconfig-system:system/aaa/authorization'
Copy link
Collaborator
@stalabi1 stalabi1 Jun 5, 2025

Choose a reason for hiding this comment

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

Suggested change
AA_AUTHORIZATION_PATH = '/data/openconfig-system:system/aaa/authorization'

duplicate

@@ -0,0 +1,3 @@
---
minor_changes:
- sonic_aaa - Add Accounting support for AAA module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/559).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- sonic_aaa - Add Accounting support for AAA module (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/559).
- sonic_aaa - Add support for accounting options (https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/559).

description:
- AAA accounting configuration.
type: dict
version_added: 3.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
version_added: 3.1.0
version_added: 3.2.0

Comment on lines +370 to +371
requests.append(self.get_delete_request(AAA_COMMANDS_ACCOUNTING_PATH, None))
requests.append(self.get_delete_request(AAA_SESSION_ACCOUNTING_PATH, None))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please delete only if accounting config is present.

Suggested change
requests.append(self.get_delete_request(AAA_COMMANDS_ACCOUNTING_PATH, None))
requests.append(self.get_delete_request(AAA_SESSION_ACCOUNTING_PATH, None))
if commands.get('accounting'):
requests.append(self.get_delete_request(AAA_COMMANDS_ACCOUNTING_PATH, None))
requests.append(self.get_delete_request(AAA_SESSION_ACCOUNTING_PATH, None))

Comment on lines +667 to +668
if not accounting:
data.pop('accounting')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if not accounting:
data.pop('accounting')
if not accounting:
data.pop('accounting')

@@ -560,3 +656,13 @@ def remove_default_entries(self, data):
authentication.pop('login_mfa_console')
if not authentication:
data.pop('authentication')
accounting = data.get('accounting')
if accounting:
< 10000 span class="blob-code-inner blob-code-marker-addition"> for acct_key in ['commands_accounting', 'session_accounting']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for acct_key in ['commands_accounting', 'session_accounting']:
for acct_key in ('commands_accounting', 'session_accounting'):

suboptions:
accounting_method:
description:
- Specifies the order of methods in which to perform accounting.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Specifies the order of methods in which to perform accounting.
- Specifies the methods in which to perform accounting.

- STOP_ONLY
accounting_console_exempt:
description:
- Exempts accounting of events from console.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Exempts accounting of events from console.
- Exempt accounting of events from console.

- STOP_ONLY
accounting_console_exempt:
description:
- Exempts accounting of events from console.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Exempts accounting of events from console.
- Exempt accounting of events from console.

Comment on lines +130 to +131
- START_STOP
- STOP_ONLY

Choose a reason for hiding this comment

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

Please change the choices to 'start-stop' and 'stop-only'

accounting = base_cfg.get('accounting')
if accounting:
accounting_dict = {}
for acct_type in ['commands_accounting', 'session_accounting']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for acct_type in ['commands_accounting', 'session_accounting']:
for acct_type in ('commands_accounting', 'session_accounting'):

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
0