Use REGEN_CONF_FILE global instead of hard-coded filename

This commit is contained in:
Alexandre Aubin 2019-04-18 15:53:16 +02:00
parent 817c3cdd41
commit 8e7684c7d5
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ from moulinette.utils.log import getActionLogger
from moulinette.utils.filesystem import read_file
from yunohost.service import _get_services, _save_services
from yunohost.regenconf import _update_conf_hashes
from yunohost.regenconf import _update_conf_hashes, REGEN_CONF_FILE
from yunohost.tools import Migration
@ -20,7 +20,7 @@ class MyMigration(Migration):
def migrate(self):
if "conffiles" not in read_file("/etc/yunohost/services.yml") \
or os.path.exists("/etc/yunohost/regenconf.yml"):
or os.path.exists(REGEN_CONF_FILE):
logger.warning(m18n.n("migration_0009_not_needed"))
return

View file

@ -67,7 +67,7 @@ def regen_conf(operation_logger, names=[], with_diff=False, force=False, dry_run
# in debian's postinst script
if os.path.exists("/etc/yunohost/installed") \
and ("conffiles" in read_file("/etc/yunohost/services.yml") \
or not os.path.exists("/etc/yunohost/regenconf.yml")):
or not os.path.exists(REGEN_CONF_FILE)):
from yunohost.tools import _get_migration_by_name
migration = _get_migration_by_name("decouple_regenconf_from_services")
migration.migrate()