Merge "Fix CNI_COMMAND=VERSION case"

This commit is contained in:
Zuul 2019-10-15 10:42:05 +00:00 committed by Gerrit Code Review
commit f3a675d40b
2 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,8 @@ def run():
else:
d = jsonutils.load(sys.stdin)
cni_conf = utils.CNIConfig(d)
args = ['--config-file', cni_conf.kuryr_conf]
args = (['--config-file', cni_conf.kuryr_conf] if 'kuryr_conf' in d
else [])
try:
if cni_conf.debug:

View File

@ -329,6 +329,8 @@ logging.register_options(CONF)
def init(args, **kwargs):
version_k8s = version.version_info.version_string()
CONF(args=args, project='kuryr-k8s', version=version_k8s, **kwargs)
if os.environ.get('CNI_COMMAND') == 'VERSION':
CONF.set_default('use_stderr', True)
def setup_logging():