Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m
"when the connected registry parent '{}' mode is '{}'. ".format(parent_name, parent.mode) +
"For more information on connected registries " +
"please visit https://aka.ms/acr/connected-registry.")
msg = "Can't create the registry '{}'. The ancestor connected ".format(connected_registry_name) +\
"registry activation status is not '{}'. ".format(ConnectedRegistryActivationStatus.ACTIVE.value) +\
"Please install the parent connected registry and try again. For more information on connected " +\
"registries, please visit https://aka.ms/acr/connected-registry."
_check_ancestors_are_active(family_tree, parent.id, msg)
_update_ancestor_permissions(cmd, family_tree, resource_group_name, registry_name, parent.id,
connected_registry_name, repositories, mode, False)

Expand Down Expand Up @@ -471,14 +466,6 @@ def _get_install_info(cmd,
# endregion


def _check_ancestors_are_active(family_tree, parent_id, msg):
while parent_id and not parent_id.isspace():
ancestor = family_tree[parent_id]["connectedRegistry"]
if ancestor.activation.status != ConnectedRegistryActivationStatus.ACTIVE.value:
raise CLIError(msg)
parent_id = ancestor.parent.id


def _update_ancestor_permissions(cmd,
family_tree,
resource_group_name,
Expand Down