Fix tests

This commit is contained in:
Alexandre Aubin 2020-04-27 20:57:38 +02:00
parent 72b412c6d3
commit e01859ffc4

View file

@ -166,7 +166,7 @@ def _app_upgradable(app_infos):
upgrade_only_if_version_changes = app_infos["manifest"].get('integration', {}).get("upgrade_only_if_version_changes", None) is True
installed_version = version.parse(app_infos.get("version", "0~ynh0"))
version_in_catalog = version.parse(app_infos.get("from_catalog", {}).get("manifest", {}).get("version", "0~ynh0"))
if app_is_in_catalog and '~ynh' in str(installed_version) and '~ynh' in str(version_in_catalog):
if upgrade_only_if_version_changes and installed_version < version_in_catalog:
return "yes"
@ -480,7 +480,7 @@ def app_upgrade(app=[], url=None, file=None, force=False):
logger.success(m18n.n('app_already_up_to_date', app=app_instance_name))
continue
# Manage upgrade type and avoid any upgrade if there is nothing to do
# Manage upgrade type and avoid any upgrade if there is nothing to do
upgrade_type = "UNKNOWN"
upgrade_only_if_version_changes = manifest.get('integration', {}).get("upgrade_only_if_version_changes", None) is True
# Get current_version and new version
@ -533,8 +533,8 @@ def app_upgrade(app=[], url=None, file=None, force=False):
env_dict["YNH_APP_INSTANCE_NAME"] = app_instance_name
env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb)
env_dict["YNH_APP_UPGRADE_TYPE"] = upgrade_type
env_dict["YNH_APP_MANIFEST_VERSION"] = app_new_version
env_dict["YNH_APP_CURRENT_VERSION"] = app_current_version
env_dict["YNH_APP_MANIFEST_VERSION"] = str(app_new_version)
env_dict["YNH_APP_CURRENT_VERSION"] = str(app_current_version)
# Start register change on system
related_to = [('app', app_instance_name)]