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

Resolved aaa and users regression playbook failures and added stable-2.13 to test matrix #90

Merged
merged 18 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- devel
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions plugins/module_utils/network/sonic/facts/aaa/aaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def get_aaa(self):
response = edit_config(self._module, to_request(self._module, request))
except ConnectionError as exc:
self._module.fail_json(msg=str(exc), code=exc.code)
data = {}
if ('openconfig-system:aaa' in response[0][1]):
if ('authentication' in response[0][1]['openconfig-system:aaa']):
data = response[0][1]['openconfig-system:aaa']['authentication']['config']
else:
data = {}
if ('config' in response[0][1]['openconfig-system:aaa']['authentication']):
data = response[0][1]['openconfig-system:aaa']['authentication']['config']
return data

def populate_facts(self, connection, ansible_facts, data=None):
Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/network/sonic/facts/users/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ def get_all_users(self):
role = role[0]
password = raw_user.get('password', None)
user = {}
if name and role and password:
if name and role:
user['name'] = name
user['role'] = role
if password:
user['password'] = password
if user:
users.append(user)
Expand Down
4 changes: 3 additions & 1 deletion tests/regression/roles/sonic_users/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ tests:
input:
- name: user1
role: operator
password: admin
update_password: on_create
- name: user2
role: admin
update_password: on_create
password: admin
update_password: on_create
- name: test_case_03
description: Delete user
state: deleted
Expand Down