mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Unused imports, black
This commit is contained in:
parent
cae7e5b5af
commit
5d685cebf0
1 changed files with 9 additions and 12 deletions
|
@ -1,17 +1,10 @@
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
import urllib
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from yunohost.utils.error import YunohostError
|
from yunohost.utils.error import YunohostError
|
||||||
from moulinette.utils.log import getActionLogger
|
from moulinette.utils.log import getActionLogger
|
||||||
from moulinette.utils.filesystem import (
|
from moulinette.utils.filesystem import read_json, write_to_yaml
|
||||||
read_json,
|
|
||||||
write_to_yaml
|
|
||||||
)
|
|
||||||
|
|
||||||
from yunohost.tools import Migration
|
from yunohost.tools import Migration
|
||||||
from yunohost.settings import settings_set
|
|
||||||
from yunohost.utils.legacy import translate_legacy_settings_to_configpanel_settings
|
from yunohost.utils.legacy import translate_legacy_settings_to_configpanel_settings
|
||||||
|
|
||||||
logger = getActionLogger("yunohost.migration")
|
logger = getActionLogger("yunohost.migration")
|
||||||
|
@ -19,6 +12,7 @@ logger = getActionLogger("yunohost.migration")
|
||||||
SETTINGS_PATH = "/etc/yunohost/settings.yml"
|
SETTINGS_PATH = "/etc/yunohost/settings.yml"
|
||||||
OLD_SETTINGS_PATH = "/etc/yunohost/settings.json"
|
OLD_SETTINGS_PATH = "/etc/yunohost/settings.json"
|
||||||
|
|
||||||
|
|
||||||
class MyMigration(Migration):
|
class MyMigration(Migration):
|
||||||
|
|
||||||
"Migrate old global settings to the new ConfigPanel global settings"
|
"Migrate old global settings to the new ConfigPanel global settings"
|
||||||
|
@ -34,11 +28,14 @@ class MyMigration(Migration):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise YunohostError("global_settings_cant_open_settings", reason=e)
|
raise YunohostError("global_settings_cant_open_settings", reason=e)
|
||||||
|
|
||||||
settings = { translate_legacy_settings_to_configpanel_settings(k): v['value'] for k,v in old_settings.items() }
|
settings = {
|
||||||
|
translate_legacy_settings_to_configpanel_settings(k): v["value"]
|
||||||
|
for k, v in old_settings.items()
|
||||||
|
}
|
||||||
|
|
||||||
if settings.get('email.smtp.smtp_relay_host') != "":
|
if settings.get("email.smtp.smtp_relay_host") != "":
|
||||||
settings['email.smtp.smtp_relay_enabled'] = "True"
|
settings["email.smtp.smtp_relay_enabled"] = "True"
|
||||||
|
|
||||||
# Here we don't use settings_set() from settings.py to prevent
|
# Here we don't use settings_set() from settings.py to prevent
|
||||||
# Questions to be asked when one run the migration from CLI.
|
# Questions to be asked when one run the migration from CLI.
|
||||||
write_to_yaml(SETTINGS_PATH, settings)
|
write_to_yaml(SETTINGS_PATH, settings)
|
||||||
|
|
Loading…
Add table
Reference in a new issue