Loading cccli/__init__.py +25 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,30 @@ CloudControl CLI ''' def git_version(): global version import os import sys from subprocess import Popen, PIPE, CalledProcessError cwd = os.getcwd() try: os.chdir(os.path.dirname(sys.argv[0])) p = Popen(["git", "log", "--pretty=format:%H" ], stdout=PIPE, stderr=open("/dev/null", "wb")) p.wait() if p.returncode == 0: githash = p.stdout.readline().strip() if len(githash) > 0: version += "-git-%s" % githash except OSError: pass finally: os.chdir(cwd) canonical_name="cc-cli" version = "5~dev0" debug = False # set version version = "5~dev0" if version.find("dev") != -1: git_version() Loading
cccli/__init__.py +25 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,30 @@ CloudControl CLI ''' def git_version(): global version import os import sys from subprocess import Popen, PIPE, CalledProcessError cwd = os.getcwd() try: os.chdir(os.path.dirname(sys.argv[0])) p = Popen(["git", "log", "--pretty=format:%H" ], stdout=PIPE, stderr=open("/dev/null", "wb")) p.wait() if p.returncode == 0: githash = p.stdout.readline().strip() if len(githash) > 0: version += "-git-%s" % githash except OSError: pass finally: os.chdir(cwd) canonical_name="cc-cli" version = "5~dev0" debug = False # set version version = "5~dev0" if version.find("dev") != -1: git_version()