Browse Source

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

Romain Rigaux 8 years ago
parent
commit
f50f65d
1 changed files with 1 additions and 1 deletions
  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"],