yunohost/src/yunohost/data_migrations/0009_migrate_to_apps_json.py
2019-02-26 01:32:52 +01:00

27 lines
734 B
Python

from moulinette.utils.log import getActionLogger
from yunohost.app import app_fetchlist, app_removelist
from yunohost.tools import Migration
logger = getActionLogger('yunohost.migration')
class MyMigration(Migration):
"Migrate from official.json to apps.json"
def migrate(self):
# Remove official.json list
app_removelist(name="yunohost")
# Replace by apps.json list
app_fetchlist(name="yunohost",
url="https://app.yunohost.org/apps.json")
def backward(self):
# Remove apps.json list
app_removelist(name="yunohost")
# Replace by official.json list
app_fetchlist(name="yunohost",
url="https://app.yunohost.org/official.json")