Smarter env/arg management
This commit is contained in:
parent
0763c573ac
commit
00ae0e4098
1 changed files with 4 additions and 5 deletions
|
|
@ -7,7 +7,6 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from urllib.parse import urlparse
|
|
||||||
|
|
||||||
import docker
|
import docker
|
||||||
|
|
||||||
|
|
@ -24,10 +23,10 @@ def _build_env(args: Namespace) -> Dict[str, any]:
|
||||||
Return:
|
Return:
|
||||||
(Dict[str, any]): the args, dictified
|
(Dict[str, any]): the args, dictified
|
||||||
"""
|
"""
|
||||||
ret = {
|
ret = {"VERSION": args.version, "EULA": True}
|
||||||
"VERSION": args.version,
|
for arg in vars(args):
|
||||||
"EULA": True,
|
if getattr(args, arg):
|
||||||
}
|
ret[arg.upper()] = getattr(args, arg)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue