From 1fda26ef4f3612ff8128336919d22e8bee3874dc Mon Sep 17 00:00:00 2001 From: ldericher Date: Tue, 18 Aug 2020 12:28:59 +0200 Subject: [PATCH] imports --- src/kiwi/subcommands/conf.py | 12 ++++++------ src/kiwi/subcommands/init.py | 6 +++--- src/kiwi/subcommands/utils/dockercommand.py | 4 +++- src/kiwi/subcommands/utils/rootkit.py | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/kiwi/subcommands/conf.py b/src/kiwi/subcommands/conf.py index 98c8bf2..9c0682d 100644 --- a/src/kiwi/subcommands/conf.py +++ b/src/kiwi/subcommands/conf.py @@ -3,13 +3,13 @@ import logging import os import subprocess -# parent -from .._constants import CONF_DIRECTORY_NAME - # local from ._subcommand import SubCommand from .utils.project import list_projects, get_project_dir -from .utils.rootkit import Rootkit, _prefix_path_mnt +from .utils.rootkit import Rootkit, prefix_path_mnt + +# parent +from .._constants import CONF_DIRECTORY_NAME class ConfCopyCommand(SubCommand): @@ -36,7 +36,7 @@ class ConfCopyCommand(SubCommand): logging.info(f"Sync directories: {conf_dirs}") Rootkit('rsync').run( - config, args, ['rsync', '-r', *_prefix_path_mnt(conf_dirs)], + config, args, ['rsync', '-r', *prefix_path_mnt(conf_dirs)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL ) @@ -57,7 +57,7 @@ class ConfPurgeCommand(SubCommand): logging.info(f"Purging directories: {conf_target}") Rootkit().run( - config, args, ['rm', '-rf', _prefix_path_mnt(conf_target)], + config, args, ['rm', '-rf', prefix_path_mnt(conf_target)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL ) diff --git a/src/kiwi/subcommands/init.py b/src/kiwi/subcommands/init.py index a8ecee6..1f3714b 100644 --- a/src/kiwi/subcommands/init.py +++ b/src/kiwi/subcommands/init.py @@ -2,12 +2,12 @@ import logging import os -# parent (display purposes only) -from .._constants import KIWI_CONF_NAME - # local from ._subcommand import SubCommand +# parent (display purposes only) +from .._constants import KIWI_CONF_NAME + def user_input(config, key, prompt): """query user for new config value""" diff --git a/src/kiwi/subcommands/utils/dockercommand.py b/src/kiwi/subcommands/utils/dockercommand.py index eb631c7..6ef40b6 100644 --- a/src/kiwi/subcommands/utils/dockercommand.py +++ b/src/kiwi/subcommands/utils/dockercommand.py @@ -3,10 +3,12 @@ import logging import subprocess # local -from ..._constants import CONF_DIRECTORY_NAME from .executable import Executable from .project import * +# parent +from ..._constants import CONF_DIRECTORY_NAME + def _update_kwargs(config, args, **kwargs): # project given in args: command affects a project in this instance diff --git a/src/kiwi/subcommands/utils/rootkit.py b/src/kiwi/subcommands/utils/rootkit.py index c9cbf96..b3686c7 100644 --- a/src/kiwi/subcommands/utils/rootkit.py +++ b/src/kiwi/subcommands/utils/rootkit.py @@ -3,12 +3,12 @@ import logging import os import subprocess -# parent -from ..._constants import IMAGES_DIRECTORY_NAME, LOCAL_IMAGES_NAME, DEFAULT_IMAGE_NAME - # local from .dockercommand import DockerCommand +# parent +from ..._constants import IMAGES_DIRECTORY_NAME, LOCAL_IMAGES_NAME, DEFAULT_IMAGE_NAME + def _prefix_path(prefix, path): if isinstance(path, str): @@ -18,7 +18,7 @@ def _prefix_path(prefix, path): return [_prefix_path(prefix, p) for p in path] -def _prefix_path_mnt(path): +def prefix_path_mnt(path): return _prefix_path('/mnt/', path)