Skip to content

Commit

Permalink
rename image_mgmt directory to image_upgrade
Browse files Browse the repository at this point in the history
Background:

Initially, image_mgmt was going to hold the module_utils for image_policy, image_upgrade, and image_upload.  I never coordinated with Mallik on this, and later decided it was a bit of organizational overkill.

This commit comprises the following:

1. Renaming directory module_utils/image_mgmt to module_utils/image_upgrade.
2. Modifying all python imports that point to module_utils/image_mgmt, to point to module_utils/image_upgrade.
3. Modifying all unit test names to replace image_mgmt with image_upgrade
4. Changing key names for all the unit tests to replace image_mgmt with image_upgrade.
  • Loading branch information
allenrobel committed Feb 18, 2024
1 parent 53a5fe0 commit 3bd708a
Show file tree
Hide file tree
Showing 41 changed files with 638 additions and 638 deletions.
4 changes: 2 additions & 2 deletions plugins/module_utils/common/controller_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

import logging

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import logging
from typing import Any, AnyStr, Dict

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
import logging
from typing import Any, Dict

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_policies import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_policies import \
ImagePolicies
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_issu_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_issu_details import \
SwitchIssuDetailsBySerialNumber


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

from ansible_collections.cisco.dcnm.plugins.module_utils.common.controller_version import \
ControllerVersion
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.rest_send import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.rest_send import \
RestSend
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_issu_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_issu_details import \
SwitchIssuDetailsBySerialNumber


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
from time import sleep
from typing import Any, Dict, List, Set

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.install_options import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.install_options import \
ImageInstallOptions
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.rest_send import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.rest_send import \
RestSend
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_issu_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_issu_details import \
SwitchIssuDetailsByIpAddress


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from time import sleep

# Using only for its failed_result property
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_task_result import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_task_result import \
ImageUpgradeTaskResult
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
from time import sleep
from typing import List, Set

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.rest_send import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.rest_send import \
RestSend
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_issu_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_issu_details import \
SwitchIssuDetailsBySerialNumber


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import time
from typing import Any, Dict

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from time import sleep

# Using only for its failed_result property
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_task_result import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_task_result import \
ImageUpgradeTaskResult
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import json
import logging

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.rest_send import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.rest_send import \
RestSend


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import json
import logging

from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.network.dcnm.dcnm import \
dcnm_send
Expand Down
36 changes: 18 additions & 18 deletions plugins/modules/dcnm_image_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,19 @@

EXAMPLES = """
# This module supports the following states:
#
# merged:
# Attach image policy to one or more devices.
# Stage image on one or more devices.
# Validate image on one or more devices.
# Upgrade image on one or more devices.
#
# query:
# Return ISSU details for one or more devices.
#
# deleted:
# Delete image policy from one or more devices
#
# Attach image policy NR3F to two devices
# Stage and validate the image on two devices but do not upgrade
Expand Down Expand Up @@ -414,27 +414,27 @@
ParamsMergeDefaults
from ansible_collections.cisco.dcnm.plugins.module_utils.common.params_validate import \
ParamsValidate
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.api_endpoints import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.api_endpoints import \
ApiEndpoints
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_policies import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_policies import \
ImagePolicies
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_policy_action import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_policy_action import \
ImagePolicyAction
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_stage import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_stage import \
ImageStage
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade import \
ImageUpgrade
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_common import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_common import \
ImageUpgradeCommon
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_upgrade_task_result import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_upgrade_task_result import \
ImageUpgradeTaskResult
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.image_validate import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.image_validate import \
ImageValidate
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.install_options import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.install_options import \
ImageInstallOptions
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_details import \
SwitchDetails
from ansible_collections.cisco.dcnm.plugins.module_utils.image_mgmt.switch_issu_details import \
from ansible_collections.cisco.dcnm.plugins.module_utils.image_upgrade.switch_issu_details import \
SwitchIssuDetailsByIpAddress


Expand Down Expand Up @@ -1326,9 +1326,9 @@ def main():
# For an example configuration, see:
# $ANSIBLE_COLLECTIONS_PATH/cisco/dcnm/plugins/module_utils/common/logging_config.json
log = Log(ansible_module)
# collection_path = "/Users/arobel/repos/collections/ansible_collections/cisco/dcnm"
# config_file = f"{collection_path}/plugins/module_utils/common/logging_config.json"
# log.config = config_file
collection_path = "/Users/arobel/repos/collections/ansible_collections/cisco/dcnm"
config_file = f"{collection_path}/plugins/module_utils/common/logging_config.json"
log.config = config_file
log.commit()

task_module = ImageUpgradeTask(ansible_module)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"test_image_mgmt_upgrade_00019a": {
"test_image_upgrade_upgrade_00019a": {
"devices": [
{
"policyName": "KR5M",
Expand Down Expand Up @@ -28,7 +28,7 @@
"writeErase": false
}
},
"test_image_mgmt_upgrade_00020a": {
"test_image_upgrade_upgrade_00020a": {
"devices": [
{
"policyName": "NR3F",
Expand Down Expand Up @@ -57,7 +57,7 @@
"writeErase": false
}
},
"test_image_mgmt_upgrade_00021a": {
"test_image_upgrade_upgrade_00021a": {
"devices": [
{
"policyName": "NR3F",
Expand Down
Loading

0 comments on commit 3bd708a

Please sign in to comment.