Skip to content

Commit

Permalink
Not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
muffato committed Nov 9, 2022
1 parent bdfdf32 commit 7ff4962
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions shpc/main/modules/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,53 +516,3 @@ def _reinstall(self, module_name, version, when_missing):
"%s is not in the Registry any more. Add --uninstall-missing or --ignore-missing."
% missing
)

def _upgrade(self, module_name, versions, upgrade=False, force=False):
result = self.registry.find(module_name)
if result:

valid_tags = container.ContainerConfig(result).tags
if upgrade:

views_with_module = set()
for version in versions:
module_dir = os.path.join(
self.settings.module_base, module_name, version
)
for view_name, entry in self.views.items():
if entry.exists(module_dir):
views_with_module.add(view_name)

self.install(module_name, allow_reinstall=True)
for view in views_with_module:
self.views[view].install(module_dir)

for version in versions:
if version != valid_tags.latest.name:
self.uninstall(module_name + ":" + version, force=True)

else:
for version in versions:
if version in valid_tags:
module_dir = os.path.join(
self.settings.module_base, module_name, version
)
these_views = []
# TODO: switch to .values()
for view_name, entry in self.views.items():
if entry.exists(module_dir):
these_views.append(entry)
self.install(module_name + ":" + version, allow_reinstall=True)
for view in these_views:
view.install(module_dir)

else:
logger.warning(
"%s:%s is not available anymore and will be skipped"
% (module_name, version)
)

else:
logger.warning(
"%s is not available anymore and will be skipped" % module_name
)

0 comments on commit 7ff4962

Please sign in to comment.