diff --git a/src/yunohost/data_migrations/0003_migrate_to_stretch.py b/src/yunohost/data_migrations/0003_migrate_to_stretch.py index 6900b678a..49e85a64e 100644 --- a/src/yunohost/data_migrations/0003_migrate_to_stretch.py +++ b/src/yunohost/data_migrations/0003_migrate_to_stretch.py @@ -85,11 +85,13 @@ class MyMigration(Migration): self.upgrade_yunohost_packages() def debian_major_version(self): - # We rely on lsb_release instead of the python module "platform", - # because "platform" relies on uname, which on some weird setups does - # not behave correctly (still says running Jessie when lsb_release says - # Stretch...) - return int(check_output("lsb_release -r").split("\t")[1][0]) + # The python module "platform" and lsb_release are not reliable because + # on some setup, they still return Release=8 even after upgrading to + # stretch ... (Apparently this is related to OVH overriding some stuff + # with /etc/lsb-release for instance -_-) + # Instead, we rely on /etc/os-release which should be the raw info from + # the distribution... + return int(check_output("grep VERSION_ID /etc/os-release | tr '\"' ' ' | cut -d ' ' -f2")) def yunohost_major_version(self): return int(get_installed_version("yunohost").split('.')[0])