diff --git a/ansible_galaxy/actions/install.py b/ansible_galaxy/actions/install.py index a843d196..7d6f95fe 100644 --- a/ansible_galaxy/actions/install.py +++ b/ansible_galaxy/actions/install.py @@ -409,6 +409,8 @@ def install_repository(galaxy_context, log.debug('found_repository_spec: %s', found_repository_spec) + display_callback('Found %s for spec %s' % (found_repository_spec, requirement_spec_to_install.label)) + # See if the found collection spec is already installed and either warn or 'force_overwrite' # to remove existing first. @@ -417,9 +419,13 @@ def install_repository(galaxy_context, # potential_repository_spec is a repo spec for the install candidate we potentially found. irdb = installed_repository_db.InstalledRepositoryDatabase(galaxy_context) - log.debug('Checking to see if %s is already installed', requirement_spec_to_install) + # log.debug('Checking to see if %s is already installed', requirement_spec_to_install) + log.debug('Checking to see if a collection named %s is already installed', found_repository_spec.label) + + repository_spec_match_filter = matchers.MatchRepositorySpecNamespaceName([found_repository_spec]) - already_installed_iter = irdb.by_requirement_spec(requirement_spec_to_install) + # already_installed_iter = irdb.by_requirement_spec(requirement_spec_to_install) + already_installed_iter = irdb.select(repository_spec_match_filter=repository_spec_match_filter) already_installed = sorted(list(already_installed_iter)) log.debug('already_installed: %s', already_installed)