diff --git a/src/connectedvmware/HISTORY.rst b/src/connectedvmware/HISTORY.rst index a2f2c4d9df3..c72c5338f20 100644 --- a/src/connectedvmware/HISTORY.rst +++ b/src/connectedvmware/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +0.2.1 +++++++ +* Bug fix for `get-resource-id` internal function, which was not honoring resource-group override. 0.2.0 ++++++ diff --git a/src/connectedvmware/azext_connectedvmware/vmware_utils.py b/src/connectedvmware/azext_connectedvmware/vmware_utils.py index dfbfbdd871e..8c031215711 100644 --- a/src/connectedvmware/azext_connectedvmware/vmware_utils.py +++ b/src/connectedvmware/azext_connectedvmware/vmware_utils.py @@ -99,9 +99,8 @@ def process_resource_name( ) rid_parts.update(child_rid_parts) - rid_parts: dict[str, str] = {} + rid_parts: Dict[str, str] = {} rid_parts.update( - resource_group=resource_group, namespace=namespace, type=_type, ) @@ -169,6 +168,8 @@ def process_resource_name( if "subscription" not in rid_parts: rid_parts["subscription"] = get_subscription_id(cmd.cli_ctx) + if "resource_group" not in rid_parts: + rid_parts["resource_group"] = resource_group return resource_id(**rid_parts) diff --git a/src/connectedvmware/azext_connectedvmware/vmware_utils_test.py b/src/connectedvmware/azext_connectedvmware/vmware_utils_test.py index fc3856178c1..1011794b64b 100644 --- a/src/connectedvmware/azext_connectedvmware/vmware_utils_test.py +++ b/src/connectedvmware/azext_connectedvmware/vmware_utils_test.py @@ -43,7 +43,7 @@ def test_get_resource_id_invalid_resource_name(self): "invalid/resource", ) - def test_get_resource_id_with_child1_id(self): + def test_get_resource_id_with_child1_id_and_diff_rg(self): cmd = self._get_test_cmd() res_id = ( @@ -53,7 +53,7 @@ def test_get_resource_id_with_child1_id(self): ) result = get_resource_id( cmd, - "contoso-rg", + "contoso-parent-rg", "Microsoft.HybridCompute", "Machines", None, diff --git a/src/connectedvmware/setup.py b/src/connectedvmware/setup.py index c1467907380..a53826f922f 100644 --- a/src/connectedvmware/setup.py +++ b/src/connectedvmware/setup.py @@ -19,7 +19,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.2.0' +VERSION = '0.2.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers