Updates to versioning system.

https://github.com/ansible/awx/issues?q=%22--first-parent%22
This commit is contained in:
Shane McDonald
2018-09-26 19:53:35 -04:00
parent 62e3b9e3b6
commit 50fe0392ed
5 changed files with 8 additions and 29 deletions

View File

@@ -22,13 +22,8 @@ docdir = "/usr/share/doc/awx"
def get_version():
current_dir = os.path.dirname(os.path.abspath(__file__))
version_file = os.path.join(current_dir, 'VERSION')
if os.path.isfile(version_file):
with open(version_file, 'r') as file:
version = file.read().strip()
else:
version = subprocess.Popen("git describe --long | cut -d - -f 1-1", shell=True, stdout=subprocess.PIPE).stdout.read().strip()
return version
with open(version_file, 'r') as file:
return file.read().strip()
if os.path.exists("/etc/debian_version"):
sysinit = "/etc/init.d"