소스 검색

openshift_facts.py: Correct error case for uninstalled systems

This adds a default value to the version to cover the case where
the user doesn't have /usr/bin/openshift on the system, correcting
the bug found in PR #646.
Samuel Munilla 9 년 전
부모
커밋
fe3ed63a6f
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      roles/openshift_facts/library/openshift_facts.py

+ 2 - 0
roles/openshift_facts/library/openshift_facts.py

@@ -605,6 +605,8 @@ def get_openshift_version():
         Returns:
             version: the current openshift version
     """
+    version = ''
+
     if os.path.isfile('/usr/bin/openshift'):
         _, output, _ = module.run_command(['/usr/bin/openshift', 'version'])
         versions = dict(e.split(' v') for e in output.splitlines())