diff --git a/bareon/cmd/agent.py b/bareon/cmd/agent.py index 6aacb1a..7f5e8d2 100644 --- a/bareon/cmd/agent.py +++ b/bareon/cmd/agent.py @@ -56,9 +56,15 @@ cli_opts = [ default='/tmp/config-drive.img', help='Path where to store generated config drive image', ), + cfg.StrOpt( + 'image_build_dir', + default='/tmp', + help='Directory where the image is supposed to be built', + ), ] CONF = cfg.CONF +CONF.register_cli_opts(cli_opts) LOG = logging.getLogger(__name__) PROJECT = "bareon" @@ -145,7 +151,6 @@ def main(actions=None): # Setup logging and process configuration options logging.register_options(CONF) - CONF.register_cli_opts(cli_opts) CONF(sys.argv[1:], project=PROJECT, version=version.version_info.release_string()) logging.setup(CONF, PROJECT) diff --git a/bareon/drivers/deploy/nailgun.py b/bareon/drivers/deploy/nailgun.py index 7c1c7df..ba3b071 100644 --- a/bareon/drivers/deploy/nailgun.py +++ b/bareon/drivers/deploy/nailgun.py @@ -115,17 +115,9 @@ opts = [ ) ] -cli_opts = [ - cfg.StrOpt( - 'image_build_dir', - default='/tmp', - help='Directory where the image is supposed to be built', - ), -] - CONF = cfg.CONF CONF.register_opts(opts) -CONF.register_cli_opts(cli_opts) +CONF.import_opt('image_build_dir', 'bareon.cmd.agent') CONF.import_opt('mpath_lvm_preferred_names', 'bareon.actions.bootloader') CONF.import_opt('lvm_conf_path', 'bareon.actions.bootloader')