Fixed bugs in argument parser passing default server config path even though server path is not specified. Island thinks that server config path was specified.

This commit is contained in:
VakarisZ 2021-05-24 17:09:14 +03:00
parent 2b257f0012
commit d273e85858
3 changed files with 2 additions and 12 deletions

View File

@ -32,4 +32,4 @@ if "__main__" == __name__:
from monkey_island.cc.main import main # noqa: E402
main(island_args.setup_only, island_args.server_config_path, config)
main(island_args.setup_only, server_config_path, config)

View File

@ -1,10 +1,5 @@
from dataclasses import dataclass
from monkey_island.cc.server_utils.consts import (
DEFAULT_SERVER_CONFIG_PATH,
DEFAULT_SHOULD_SETUP_ONLY,
)
@dataclass
class IslandCmdArgs:
@ -26,13 +21,9 @@ def parse_cli_args() -> IslandCmdArgs:
help="Pass this flag to cause the Island to setup and exit without actually starting. "
"This is useful for preparing Island to boot faster later-on, so for "
"compiling/packaging Islands.",
default=DEFAULT_SHOULD_SETUP_ONLY,
)
parser.add_argument(
"--server-config",
action="store",
help="The path to the server configuration file.",
default=DEFAULT_SERVER_CONFIG_PATH,
"--server-config", action="store", help="The path to the server configuration file."
)
args = parser.parse_args()

View File

@ -30,4 +30,3 @@ DEFAULT_DEVELOP_SERVER_CONFIG_PATH = os.path.join(
DEFAULT_LOG_LEVEL = "INFO"
DEFAULT_START_MONGO_DB = True
DEFAULT_SHOULD_SETUP_ONLY = False