Skip to content

Commit

Permalink
dcnm_vrf: diff_for_create() consistent return statements
Browse files Browse the repository at this point in the history
1. The first return statement was inconsistent with the second return statement.  Fixed by adding the boolean configuration_changed to the first return statement.

2. All the other changes are due to running the black and isort linters.
  • Loading branch information
allenrobel committed Dec 20, 2024
1 parent a3ccb52 commit 1ced9a1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions plugins/modules/dcnm_vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,9 @@

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import (
dcnm_get_ip_addr_info, dcnm_get_url, dcnm_send, dcnm_version_supported, get_fabric_details,
get_fabric_inventory_details, get_ip_sn_dict, get_ip_sn_fabric_dict,
validate_list_of_dicts)
dcnm_get_ip_addr_info, dcnm_get_url, dcnm_send, dcnm_version_supported,
get_fabric_details, get_fabric_inventory_details, get_ip_sn_dict,
get_ip_sn_fabric_dict, validate_list_of_dicts)

from ..module_utils.common.log_v2 import Log

Expand Down Expand Up @@ -689,20 +689,20 @@ def __init__(self, module):
def get_list_of_lists(lst: list, size: int) -> list[list]:
"""
# Summary
Given a list of items (lst) and a chunk size (size), return a
list of lists, where each list is size items in length.
## Raises
- ValueError if:
- lst is not a list.
- size is not an integer
## Example
print(get_lists_of_lists([1,2,3,4,5,6,7], 3)
# -> [[1, 2, 3], [4, 5, 6], [7]]
"""
if not isinstance(lst, list):
Expand All @@ -712,8 +712,8 @@ def get_list_of_lists(lst: list, size: int) -> list[list]:
if not isinstance(size, int):
msg = "size must be an integer. "
msg += f"Got {type(size)}."
raise ValueError(msg)
return [lst[x:x+size] for x in range(0, len(lst), size)]
raise ValueError(msg)
return [lst[x : x + size] for x in range(0, len(lst), size)]

@staticmethod
def find_dict_in_list_by_key_value(search: list, key: str, value: str):
Expand Down Expand Up @@ -1258,7 +1258,7 @@ def diff_for_create(self, want, have):

configuration_changed = False
if not have:
return {}
return {}, configuration_changed

create = {}

Expand Down Expand Up @@ -1574,7 +1574,7 @@ def get_have(self):

msg = f"lite_objects: {json.dumps(lite_objects, indent=4, sort_keys=True)}"
self.log.debug(msg)

for sdl in lite_objects["DATA"]:
for epv in sdl["switchDetailsList"]:
if not epv.get("extensionValues"):
Expand Down

0 comments on commit 1ced9a1

Please sign in to comment.