Skip to content

Commit f0d281e

Browse files
Add infra deployment cleanup
1 parent 86141d2 commit f0d281e

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

infrastructure/afd-apim/clean-up.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"from apimtypes import INFRASTRUCTURE\n",
2020
"\n",
2121
"deployment = INFRASTRUCTURE.AFD_APIM_PE\n",
22-
"index = 1\n",
22+
"indexes = [1]\n",
2323
"\n",
24-
"utils.cleanup_resources(deployment, utils.get_infra_rg_name(deployment, index))"
24+
"utils.cleanup_infra_deployments(deployment, indexes)"
2525
]
2626
}
2727
],

infrastructure/apim-aca/clean-up.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"from apimtypes import INFRASTRUCTURE\n",
2020
"\n",
2121
"deployment = INFRASTRUCTURE.APIM_ACA\n",
22-
"index = 1\n",
22+
"indexes = [1]\n",
2323
"\n",
24-
"utils.cleanup_resources(deployment, utils.get_infra_rg_name(deployment, index))"
24+
"utils.cleanup_infra_deployments(deployment, indexes)"
2525
]
2626
}
2727
],

infrastructure/simple-apim/clean-up.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"from apimtypes import INFRASTRUCTURE\n",
2020
"\n",
2121
"deployment = INFRASTRUCTURE.SIMPLE_APIM\n",
22-
"index = 1\n",
22+
"indexes = [1]\n",
2323
"\n",
24-
"utils.cleanup_resources(deployment, utils.get_infra_rg_name(deployment, index))"
24+
"utils.cleanup_infra_deployments(deployment, indexes)"
2525
]
2626
}
2727
],
@@ -41,7 +41,7 @@
4141
"name": "python",
4242
"nbconvert_exporter": "python",
4343
"pygments_lexer": "ipython3",
44-
"version": "3.12.9"
44+
"version": "3.12.10"
4545
}
4646
},
4747
"nbformat": 4,

shared/python/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _cleanup_resources(deployment_name: str, rg_name: str) -> None:
334334
# PUBLIC METHODS
335335
# ------------------------------
336336

337-
def cleanup_infra_deployment(deployment: INFRASTRUCTURE, indexes: int | list[int] | None = None) -> None:
337+
def cleanup_infra_deployments(deployment: INFRASTRUCTURE, indexes: int | list[int] | None = None) -> None:
338338
"""
339339
Clean up infrastructure deployments by deployment enum and index/indexes.
340340
Obtains the infra resource group name for each index and calls the private cleanup method.

tests/python/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ def test_cleanup_resources_smoke(monkeypatch):
159159

160160
def test_cleanup_infra_deployment_single(monkeypatch):
161161
monkeypatch.setattr(utils, '_cleanup_resources', lambda deployment_name, rg_name: None)
162-
utils.cleanup_infra_deployment(INFRASTRUCTURE.SIMPLE_APIM, None)
163-
utils.cleanup_infra_deployment(INFRASTRUCTURE.SIMPLE_APIM, 1)
164-
utils.cleanup_infra_deployment(INFRASTRUCTURE.SIMPLE_APIM, [1, 2])
162+
utils.cleanup_infra_deployments(INFRASTRUCTURE.SIMPLE_APIM, None)
163+
utils.cleanup_infra_deployments(INFRASTRUCTURE.SIMPLE_APIM, 1)
164+
utils.cleanup_infra_deployments(INFRASTRUCTURE.SIMPLE_APIM, [1, 2])
165165

166166
def test_cleanup_deployment_single(monkeypatch):
167167
monkeypatch.setattr(utils, '_cleanup_resources', lambda deployment_name, rg_name: None)

0 commit comments

Comments
 (0)