Smarter env/arg management

This commit is contained in:
oitsjustjose 2021-06-10 21:12:55 -05:00
commit 00ae0e4098

View file

@ -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