소스 검색

HUE-6080 [metadata] Avoid none casting in navopt lib versioner

Romain Rigaux 8 년 전
부모
커밋
f50f65d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/core/ext-py/navoptapi-0.1.0/ccscli/_version.py

+ 1 - 1
desktop/core/ext-py/navoptapi-0.1.0/ccscli/_version.py

@@ -295,7 +295,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
         pieces["closest-tag"] = None
         count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
                                     cwd=root)
-        pieces["distance"] = int(count_out)  # total number of commits
+        pieces["distance"] = int(count_out) if count_out is not None else 0  # total number of commits
 
     # commit date: see ISO-8601 comment in git_versions_from_keywords()
     date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],