Unused imports, PEP8

This commit is contained in:
Alexandre Aubin 2018-05-10 22:58:28 +02:00
parent 2843ce923d
commit e848524912

View file

@ -1,10 +1,5 @@
import glob
import os
import requests
import base64
import time
import json
import errno
from shutil import copy2
from moulinette import m18n, msettings
@ -16,7 +11,6 @@ from moulinette.utils.filesystem import read_file
from yunohost.tools import Migration
from yunohost.app import unstable_apps
from yunohost.service import (_run_service_command,
service_regen_conf,
manually_modified_files,
manually_modified_files_compared_to_debian_default)
from yunohost.utils.filesystem import free_space_in_directory
@ -26,6 +20,7 @@ logger = getActionLogger('yunohost.migration')
YUNOHOST_PACKAGES = ["yunohost", "yunohost-admin", "moulinette", "ssowat"]
class MyMigration(Migration):
"Upgrade the system to Debian Stretch and Yunohost 3.0"
@ -113,7 +108,7 @@ class MyMigration(Migration):
# Check system is up to date
# (but we don't if 'stretch' is already in the sources.list ...
# which means maybe a previous upgrade crashed and we're re-running it)
if not " stretch " in read_file("/etc/apt/sources.list"):
if " stretch " not in read_file("/etc/apt/sources.list"):
self.apt_update()
apt_list_upgradable = check_output("apt list --upgradable -a")
if "upgradable" in apt_list_upgradable:
@ -232,7 +227,6 @@ class MyMigration(Migration):
os.system(command)
def apt_dist_upgrade(self, conf_flags):
# Make apt-get happy
@ -264,7 +258,6 @@ class MyMigration(Migration):
# enabled if the user explicitly add --verbose ...
os.system(command)
# Those are files that should be kept and restored before the final switch
# to yunohost 3.x... They end up being modified by the various dist-upgrades
# (or need to be taken out momentarily), which then blocks the regen-conf
@ -304,4 +297,3 @@ class MyMigration(Migration):
for f in self.files_to_keep:
dest_file = f.strip('/').replace("/", "_")
copy2(os.path.join(tmp_dir, dest_file), f)