[enh] Avoid to modify untestable migrations

This commit is contained in:
ljf 2019-08-14 17:29:24 +02:00
parent ed3e014fee
commit fac44f44d0
2 changed files with 6 additions and 17 deletions

View file

@ -11,10 +11,5 @@ class MyMigration(Migration):
all_certificate_files = glob.glob("/etc/yunohost/certs/*/*.pem")
def run(self):
try:
for filename in self.all_certificate_files:
chown(filename, uid="root", gid="ssl-cert")
except Exception:
for filename in self.all_certificate_files:
chown(filename, uid="root", gid="metronome")
raise

View file

@ -55,13 +55,7 @@ class MyMigration(Migration):
# right after the regenconf, such that it will appear as
# "manually modified".
if os.path.exists('/etc/yunohost/from_script'):
try:
rm('/etc/yunohost/from_script')
copyfile(SSHD_CONF, '/etc/ssh/sshd_config.bkp')
regen_conf(names=['ssh'], force=True)
copyfile('/etc/ssh/sshd_config.bkp', SSHD_CONF)
except Exception:
if os.path.exists('/etc/yunohost/sshd_config.bkp'):
copyfile('/etc/ssh/sshd_config.bkp', SSHD_CONF)
_run_service_command('restart', 'ssh')
raise