Skip to content

Commit

Permalink
Merge pull request #387 from aristanetworks/devel
Browse files Browse the repository at this point in the history
v3.2.2
  • Loading branch information
titom73 authored Jul 22, 2021
2 parents b551b87 + fce63a4 commit 93d3293
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
code_v3: ${{ steps.filter.outputs.code_v3 }}
dhcp_module: ${{ steps.filter.outputs.dhcp_module }}
docs: ${{ steps.filter.outputs.docs }}
python: ${{ steps.filter.outputs.python }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
Expand Down Expand Up @@ -56,6 +57,8 @@ jobs:
- 'ansible_collections/arista/cvp/roles/**/README.md'
- '.github/workflows/documentation-check.yml'
- '.github/workflows/documentation-build.yml'
python:
- 'ansible_collections/arista/cvp/plugins/**/*.py'
pre_commit:
name: Run pre-commit validation hooks
Expand Down Expand Up @@ -219,8 +222,8 @@ jobs:
name: Test galaxy-importer
runs-on: ubuntu-latest
container: avdteam/base:3.6-v2.0
needs: [molecule_dhcp, pytest]
# if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.base_ref, 'refs/heads/release')
needs: [pre_commit]
if: needs.file-changes.outputs.python == 'true' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/release')
env:
PY_COLORS: 1 # allows molecule colors to be passed to GitHub Actions
ANSIBLE_FORCE_COLOR: 1 # allows ansible colors to be passed to GitHub Actions
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ help: ## Display help message (*: main entry points / []: part of an entry point
#########################################
.PHONY: collection-build
collection-build: ## Build arista.cvp collection locally
ansible-galaxy collection build --force ansible_collections/arista/cvp
rm -rf ansible_collections/arista/cvp/molecule/ ; \
ansible-galaxy collection build --force ansible_collections/arista/cvp ; \
git checkout ansible_collections/arista/cvp/molecule/

.PHONY: collection-install
collection-install: ## Install arista.cvp collection to default location (~/.ansible/collections/ansible_collections)
Expand Down
7 changes: 7 additions & 0 deletions ansible_collections/arista/cvp/docs/release-notes/v3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
- On premise version higher than 2018.2.5
- Cloudvision as a Service

## Release 3.1.2

### Enhancements

- Apply python linting warning in import (#385)
- Remove Molecule from collection build process (#386)

## Release 3.1.1

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/cvp/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace: arista
name: cvp

# The version of the collection. Must be compatible with semantic versioning
version: 3.1.1
version: 3.1.2

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def apply(self, configlet_list: list, present: bool = True, note: str = 'Managed
configlet['notediff'] = self._compare(
fromText=cv_data['note'], toText=note, fromName='CVP', toName='Ansible')
MODULE_LOGGER.debug("configlet note diff: %s", str(configlet['notediff']))
if (configlet['diff'][0]) == True or (configlet['notediff'][0] == True):
if (configlet['diff'][0]) is True or (configlet['notediff'][0] is True):
to_update.append(configlet)

else:
Expand Down Expand Up @@ -341,13 +341,13 @@ def update(self, to_update: list, note: str = 'Managed by Ansible AVD'):
change_response.add_entry('configlet updated')
if 'diff' in configlet:
# Change changed flag if diff is True
if configlet['diff'] is not None and configlet['diff'][0] == True:
if configlet['diff'] is not None and configlet['diff'][0] is True:
change_response.diff = configlet['diff']
change_response.changed = True
MODULE_LOGGER.info(
'Found diff in configlet %s.', str(configlet['name']))
if 'notediff' in configlet:
if configlet['notediff'] is not None and configlet['notediff'][0] == True:
if configlet['notediff'] is not None and configlet['notediff'][0] is True:
change_response.diff = configlet['notediff']
change_response.changed = True
MODULE_LOGGER.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ def __get_reordered_configlets_list(self, configlet_applied_to_device_list, conf
# Joining the 2 new list (configlets already present + new configlet in right order)
return configlets_attached_get_configlet_info + new_configlets_list


# ------------------------------------------ #
# Get CV data functions
# ------------------------------------------ #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
WINDOWS_LINE_ENDING = '\r\n'
UNIX_LINE_ENDING = '\n'


def str_cleanup_line_ending(content):
"""
str_cleanup_line_ending Cleanup line ending to use UNIX style and not Windows style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def build_configlets_list(module):
configlet_compare = tools.compare(
configlet['config'], ansible_configlet, 'CVP', 'Ansible')
# Compare function returns a list containing a boolean and a unified diff list.
if configlet_compare[0] == False:
if configlet_compare[0] is False:
intend['keep'].append({'data': configlet})
MODULE_LOGGER.debug("No change was detected in configlet %s.", str(configlet['name']))
else:
Expand Down

0 comments on commit 93d3293

Please sign in to comment.