Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
KB-perByte authored Jan 31, 2024
2 parents 05fbc71 + d4b3c01 commit 396f8d7
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 131 deletions.
6 changes: 4 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---

profile: production

exclude_paths:
- changelogs/changelog.yaml
# exclude_paths:

# - changelogs/changelog.yaml
10 changes: 3 additions & 7 deletions .github/workflows/ack.yml → .github/workflows/check_label.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml
name: ack

name: "Check label"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on: # yamllint disable-line rule:truthy
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
ack:
uses: ansible/devtools/.github/workflows/ack.yml@main
check_label:
uses: ansible/ansible-content-actions/.github/workflows/check_label.yaml@main
3 changes: 2 additions & 1 deletion .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
name: code_coverage
name: "Code coverage"

on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
branches: [ main ]

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/draft_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: "Draft release"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
workflow_dispatch:
env:
NAMESPACE: ${{ github.repository_owner }}
COLLECTION_NAME: ios
ANSIBLE_COLLECTIONS_PATHS: ./
jobs:
update_release_draft:
uses: ansible/ansible-content-actions/.github/workflows/draft_release.yaml@main
with:
repo: ${{ github.event.pull_request.head.repo.full_name }}
secrets:
BOT_PAT: ${{ secrets.BOT_PAT }}
13 changes: 0 additions & 13 deletions .github/workflows/lint.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/push.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: release
name: "Release collection"
on: # yamllint disable-line rule:truthy
release:
types: [published]

jobs:
release:
uses: ansible/devtools/.github/workflows/release_collection.yml@main
uses: ansible/ansible-content-actions/.github/workflows/release.yaml@main
with:
environment: release
secrets:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: CI
name: "CI"

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand All @@ -12,15 +12,16 @@ on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * *'


jobs:
changelog:
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
if: github.event_name != 'schedule'
uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
if: github.event_name == 'pull_request'
ansible-lint:
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
sanity:
uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
unit-galaxy:
uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main
uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main
unit-source:
uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
with:
Expand All @@ -33,14 +34,15 @@ jobs:
- changelog
- sanity
- unit-galaxy
- unit-source
- ansible-lint
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert 'failure' not in
set([
'${{ needs.changelog.result }}',
'${{ needs.sanity.result }}',
'${{ needs.unit-galaxy.result }}',
'${{ needs.unit-galaxy.result }}'
'${{ needs.ansible-lint.result }}'
'${{ needs.unit-source.result }}'
])"
3 changes: 3 additions & 0 deletions changelogs/fragments/snmp_idempotancy_fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ios_snmp_server - fixed config issue with snmp user password update being idempotent on consecutive runs.
45 changes: 13 additions & 32 deletions plugins/module_utils/network/ios/config/snmp_server/snmp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,39 +237,20 @@ def _compare(self, want, have):
def _compare_lists_attrs(self, want, have):
"""Compare list of dict"""
for _parser in self.list_parsers:
if _parser == "users":
i_want = want.get(_parser, {})
i_have = have.get(_parser, {})
for key, wanting in iteritems(i_want):
wanting_compare = deepcopy(wanting)
if (
"authentication" in wanting_compare
and "password" in wanting_compare["authentication"]
):
wanting_compare["authentication"].pop("password")
if (
"encryption" in wanting_compare
and "password" in wanting_compare["encryption"]
):
wanting_compare["encryption"].pop("password")
haveing = i_have.pop(key, {})
if wanting_compare != haveing:
if haveing and self.state in ["overridden", "replaced"]:
i_want = want.get(_parser, {})
i_have = have.get(_parser, {})
for key, wanting in iteritems(i_want):
haveing = i_have.pop(key, {})
if wanting != haveing:
if haveing and self.state in ["overridden", "replaced"]:
if not (
_parser == "users"
and wanting.get("username") == haveing.get("username")
):
self.addcmd(haveing, _parser, negate=True)
self.addcmd(wanting, _parser)
for key, haveing in iteritems(i_have):
self.addcmd(haveing, _parser, negate=True)
else:
i_want = want.get(_parser, {})
i_have = have.get(_parser, {})
for key, wanting in iteritems(i_want):
haveing = i_have.pop(key, {})
if wanting != haveing:
if haveing and self.state in ["overridden", "replaced"]:
self.addcmd(haveing, _parser, negate=True)
self.addcmd(wanting, _parser)
for key, haveing in iteritems(i_have):
self.addcmd(haveing, _parser, negate=True)
self.addcmd(wanting, _parser)
for key, haveing in iteritems(i_have):
self.addcmd(haveing, _parser, negate=True)

def _snmp_list_to_dict(self, data):
"""Convert all list of dicts to dicts of dicts"""
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For ansible-tox-linters
black==23.3.0 ; python_version >= '3.7'
black==23.3.0
flake8
yamllint

Expand Down
Loading

0 comments on commit 396f8d7

Please sign in to comment.