1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 13:43:01 +00:00
This commit is contained in:
Jörn-Michael Miehe 2021-09-22 03:06:43 +02:00
parent b9db18b09c
commit 09836743bb
11 changed files with 14 additions and 19 deletions

View file

@ -1,7 +1,6 @@
# system # system
import os import os
############# #############
# ENVIRONMENT # ENVIRONMENT
@ -10,7 +9,6 @@ KIWI_ROOT = os.getenv('KIWI_ROOT', ".")
# default name of kiwi-scp file # default name of kiwi-scp file
KIWI_CONF_NAME = os.getenv('KIWI_CONF_NAME', "kiwi.yml") KIWI_CONF_NAME = os.getenv('KIWI_CONF_NAME', "kiwi.yml")
############ ############
# FILE NAMES # FILE NAMES
@ -27,7 +25,6 @@ CONF_DIRECTORY_NAME = 'conf'
# location for auxiliary Dockerfiles # location for auxiliary Dockerfiles
IMAGES_DIRECTORY_NAME = f"{KIWI_ROOT}/images" IMAGES_DIRECTORY_NAME = f"{KIWI_ROOT}/images"
#################### ####################
# DOCKER IMAGE NAMES # DOCKER IMAGE NAMES

View file

@ -1,6 +1,6 @@
def _surround(string, bang): def _surround(string, bang):
midlane = f"{bang * 3} {string} {bang * 3}" midlane = f"{bang * 3} {string} {bang * 3}"
sidelane = bang*len(midlane) sidelane = bang * len(midlane)
return f"{sidelane}\n{midlane}\n{sidelane}" return f"{sidelane}\n{midlane}\n{sidelane}"

View file

@ -1,10 +1,9 @@
import logging import logging
import os import os
from .executable import Executable
from ._constants import CONF_DIRECTORY_NAME from ._constants import CONF_DIRECTORY_NAME
from .config import LoadedConfig from .config import LoadedConfig
from .executable import Executable
class Project: class Project:

View file

@ -4,11 +4,11 @@ import subprocess
# local # local
from .._constants import CONF_DIRECTORY_NAME from .._constants import CONF_DIRECTORY_NAME
from ..executable import Executable
from ..subcommand import SubCommand
from ..config import LoadedConfig from ..config import LoadedConfig
from ..executable import Executable
from ..projects import Projects from ..projects import Projects
from ..rootkit import Rootkit, prefix_path_mnt from ..rootkit import Rootkit, prefix_path_mnt
from ..subcommand import SubCommand
class ConfCopyCommand(SubCommand): class ConfCopyCommand(SubCommand):

View file

@ -4,10 +4,10 @@ import subprocess
# local # local
from ._hidden import _find_net from ._hidden import _find_net
from ..subcommand import ServiceCommand
from ..config import LoadedConfig from ..config import LoadedConfig
from ..executable import Executable from ..executable import Executable
from ..misc import are_you_sure from ..misc import are_you_sure
from ..subcommand import ServiceCommand
class DownCommand(ServiceCommand): class DownCommand(ServiceCommand):

View file

@ -4,8 +4,8 @@ import os
# local # local
from .._constants import KIWI_CONF_NAME from .._constants import KIWI_CONF_NAME
from ..subcommand import SubCommand
from ..config import DefaultConfig, LoadedConfig from ..config import DefaultConfig, LoadedConfig
from ..subcommand import SubCommand
class InitCommand(SubCommand): class InitCommand(SubCommand):
@ -42,7 +42,6 @@ class InitCommand(SubCommand):
# check force switch # check force switch
if args.force and os.path.isfile(KIWI_CONF_NAME): if args.force and os.path.isfile(KIWI_CONF_NAME):
logging.warning(f"Overwriting existing '{KIWI_CONF_NAME}'!") logging.warning(f"Overwriting existing '{KIWI_CONF_NAME}'!")
config = DefaultConfig.get() config = DefaultConfig.get()

View file

@ -4,10 +4,10 @@ import subprocess
# local # local
from ._hidden import _find_net from ._hidden import _find_net
from ..subcommand import SubCommand
from ..config import LoadedConfig from ..config import LoadedConfig
from ..executable import Executable from ..executable import Executable
from ..misc import are_you_sure from ..misc import are_you_sure
from ..subcommand import SubCommand
class PurgeCommand(SubCommand): class PurgeCommand(SubCommand):

View file

@ -1,6 +1,6 @@
# local # local
from ..subcommand import ServiceCommand
from ..misc import are_you_sure from ..misc import are_you_sure
from ..subcommand import ServiceCommand
class RestartCommand(ServiceCommand): class RestartCommand(ServiceCommand):

View file

@ -2,9 +2,9 @@
import logging import logging
import subprocess import subprocess
from ..config import LoadedConfig
# local # local
from ..subcommand import ServiceCommand from ..subcommand import ServiceCommand
from ..config import LoadedConfig
def _service_has_executable(project, service, exe_name): def _service_has_executable(project, service, exe_name):
@ -52,7 +52,7 @@ def _find_shell(args, project, service):
elif i + 1 < len(shells): elif i + 1 < len(shells):
# try next in list # try next in list
logging.info(f"Shell '{shell}' not found in container, trying '{shells[i+1]}'") logging.info(f"Shell '{shell}' not found in container, trying '{shells[i + 1]}'")
elif args.shell: elif args.shell:
# not found, user suggestion provided # not found, user suggestion provided

View file

@ -3,10 +3,10 @@ import logging
import os import os
import yaml import yaml
# local
from ..subcommand import ServiceCommand
from ..project import Project from ..project import Project
from ..projects import Projects from ..projects import Projects
# local
from ..subcommand import ServiceCommand
def _print_list(strings): def _print_list(strings):

View file

@ -1,6 +1,6 @@
# local # local
from ..subcommand import ServiceCommand
from ..misc import are_you_sure from ..misc import are_you_sure
from ..subcommand import ServiceCommand
class UpdateCommand(ServiceCommand): class UpdateCommand(ServiceCommand):