mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Avoid to modify untestable migrations
This commit is contained in:
parent
ed3e014fee
commit
fac44f44d0
2 changed files with 6 additions and 17 deletions
|
@ -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
|
||||
for filename in self.all_certificate_files:
|
||||
chown(filename, uid="root", gid="ssl-cert")
|
||||
|
|
|
@ -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
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue