mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-24 13:43:01 +00:00
reformat
This commit is contained in:
parent
b9db18b09c
commit
09836743bb
11 changed files with 14 additions and 19 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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}"
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
|
@ -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):
|
||||||
|
@ -8,7 +8,7 @@ class UpdateCommand(ServiceCommand):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
'update', num_projects='?', num_services='*',
|
'update', num_projects='?', num_services='*',
|
||||||
action="Updating",
|
action="Updating",
|
||||||
description="Update the whole instance, a project or service(s) inside a project"
|
description="Update the whole instance, a project or service(s) inside a project"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue