Add --proxy to lorax-composer cmdline
Overrides the [dnf] proxy setting in the config file.
This commit is contained in:
parent
12cb2736ac
commit
0455a5d740
@ -58,6 +58,8 @@ def configure(conf_file="/etc/lorax/composer.conf", root_dir="/", test_config=Fa
|
|||||||
conf.set("repos", "use_system_repos", "1")
|
conf.set("repos", "use_system_repos", "1")
|
||||||
conf.set("repos", "enabled", "*")
|
conf.set("repos", "enabled", "*")
|
||||||
|
|
||||||
|
conf.add_section("dnf")
|
||||||
|
|
||||||
if not test_config:
|
if not test_config:
|
||||||
# read the config file
|
# read the config file
|
||||||
if os.path.isfile(conf_file):
|
if os.path.isfile(conf_file):
|
||||||
|
@ -71,6 +71,8 @@ def get_parser():
|
|||||||
help="Release version to use for $releasever in dnf repository urls")
|
help="Release version to use for $releasever in dnf repository urls")
|
||||||
parser.add_argument("--tmp", default="/var/tmp",
|
parser.add_argument("--tmp", default="/var/tmp",
|
||||||
help="Top level temporary directory")
|
help="Top level temporary directory")
|
||||||
|
parser.add_argument("--proxy", default=None, metavar="PROXY",
|
||||||
|
help="Set proxy for DNF, overrides configuration file setting.")
|
||||||
parser.add_argument("BLUEPRINTS", metavar="BLUEPRINTS",
|
parser.add_argument("BLUEPRINTS", metavar="BLUEPRINTS",
|
||||||
help="Path to the blueprints")
|
help="Path to the blueprints")
|
||||||
|
|
||||||
@ -230,6 +232,10 @@ if __name__ == '__main__':
|
|||||||
if opts.sharedir:
|
if opts.sharedir:
|
||||||
server.config["COMPOSER_CFG"].set("composer", "share_dir", opts.sharedir)
|
server.config["COMPOSER_CFG"].set("composer", "share_dir", opts.sharedir)
|
||||||
|
|
||||||
|
# Override the config file's DNF proxy setting
|
||||||
|
if opts.proxy:
|
||||||
|
server.config["COMPOSER_CFG"].set("dnf", "proxy", opts.proxy)
|
||||||
|
|
||||||
# Make sure the queue paths are setup correctly, exit on errors
|
# Make sure the queue paths are setup correctly, exit on errors
|
||||||
errors = make_queue_dirs(server.config["COMPOSER_CFG"], gid)
|
errors = make_queue_dirs(server.config["COMPOSER_CFG"], gid)
|
||||||
if errors:
|
if errors:
|
||||||
|
Loading…
Reference in New Issue
Block a user