This commit is contained in:
Jörn-Michael Miehe 2020-08-18 12:28:59 +02:00
parent 5b489d0392
commit 1fda26ef4f
4 changed files with 16 additions and 14 deletions

View file

@ -3,13 +3,13 @@ import logging
import os import os
import subprocess import subprocess
# parent
from .._constants import CONF_DIRECTORY_NAME
# local # local
from ._subcommand import SubCommand from ._subcommand import SubCommand
from .utils.project import list_projects, get_project_dir 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): class ConfCopyCommand(SubCommand):
@ -36,7 +36,7 @@ class ConfCopyCommand(SubCommand):
logging.info(f"Sync directories: {conf_dirs}") logging.info(f"Sync directories: {conf_dirs}")
Rootkit('rsync').run( 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 stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
) )
@ -57,7 +57,7 @@ class ConfPurgeCommand(SubCommand):
logging.info(f"Purging directories: {conf_target}") logging.info(f"Purging directories: {conf_target}")
Rootkit().run( 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 stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
) )

View file

@ -2,12 +2,12 @@
import logging import logging
import os import os
# parent (display purposes only)
from .._constants import KIWI_CONF_NAME
# local # local
from ._subcommand import SubCommand from ._subcommand import SubCommand
# parent (display purposes only)
from .._constants import KIWI_CONF_NAME
def user_input(config, key, prompt): def user_input(config, key, prompt):
"""query user for new config value""" """query user for new config value"""

View file

@ -3,10 +3,12 @@ import logging
import subprocess import subprocess
# local # local
from ..._constants import CONF_DIRECTORY_NAME
from .executable import Executable from .executable import Executable
from .project import * from .project import *
# parent
from ..._constants import CONF_DIRECTORY_NAME
def _update_kwargs(config, args, **kwargs): def _update_kwargs(config, args, **kwargs):
# project given in args: command affects a project in this instance # project given in args: command affects a project in this instance

View file

@ -3,12 +3,12 @@ import logging
import os import os
import subprocess import subprocess
# parent
from ..._constants import IMAGES_DIRECTORY_NAME, LOCAL_IMAGES_NAME, DEFAULT_IMAGE_NAME
# local # local
from .dockercommand import DockerCommand from .dockercommand import DockerCommand
# parent
from ..._constants import IMAGES_DIRECTORY_NAME, LOCAL_IMAGES_NAME, DEFAULT_IMAGE_NAME
def _prefix_path(prefix, path): def _prefix_path(prefix, path):
if isinstance(path, str): if isinstance(path, str):
@ -18,7 +18,7 @@ def _prefix_path(prefix, path):
return [_prefix_path(prefix, p) for p in 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) return _prefix_path('/mnt/', path)