Skip to content

Commit

Permalink
Making function "return" changes for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Ausbeth committed Sep 26, 2024
1 parent c3b918a commit d50a87a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions shpc/client/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ def upgrade(name, cli, args, dryrun=False, force=False):

# Compare the latest version with the user's installed version
if any(latest_version_tag in versions for versions in installed_versions.values()):
if dryrun:
return None # No upgrade available
logger.info("You have the latest version of " + name + " installed already")
return False # No upgrade occured

if not dryrun:
logger.info("You have the latest version of " + name + " installed already")
return None # No upgrade necessary

else:
if dryrun:
return latest_version_tag # Return the latest version for upgrade information
Expand Down Expand Up @@ -139,7 +138,7 @@ def upgrade(name, cli, args, dryrun=False, force=False):
cli.view_install(view_name, name)
logger.info(f"Installed the latest version of {name} to view: {view_name}")

return True # Upgrade occured
return latest_version_tag # Upgrade occured


def get_latest_version(name, config):
Expand Down
2 changes: 1 addition & 1 deletion shpc/main/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def upgrade(self, name, dryrun=False, force=False):
"""
Upgrade an outdated software
"""
from shpc.client.upgrade import upgrade as upgrade
from shpc.client.upgrade import upgrade
cli = self
args = {}
upgrade(name, cli, args, dryrun=dryrun, force=force)
Expand Down

0 comments on commit d50a87a

Please sign in to comment.