mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-12-25 18:42:59 +00:00
imports
This commit is contained in:
parent
5b489d0392
commit
1fda26ef4f
4 changed files with 16 additions and 14 deletions
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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"""
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue