From 0f6ab5b5e76a8394c42f90de9f5134e606da5a6c Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Wed, 30 Sep 2015 01:15:32 +0200 Subject: [PATCH] Cherry picking changes on checksum.fact. --- roles/prereq/templates/checksum.fact | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/prereq/templates/checksum.fact b/roles/prereq/templates/checksum.fact index f11bb6b..c4d2ab5 100644 --- a/roles/prereq/templates/checksum.fact +++ b/roles/prereq/templates/checksum.fact @@ -1,6 +1,6 @@ #!/usr/bin/env python -from os import popen +from subprocess import Popen, PIPE, STDOUT from os.path import isfile from json import dumps, loads from hashlib import md5 @@ -15,8 +15,9 @@ local_repo_hash = '' live_repo_hash = '' # Getting live versions for repo -repover = popen("pushd %s >/dev/null; git log --pretty=oneline -1 | cut -d' ' -f 1; popd > /dev/null" % repo_path) -live_repo_hash = repover.read().strip() +p = Popen("pushd %s >/dev/null; git log --pretty=oneline -1 | cut -d' ' -f 1; popd > /dev/null" % repo_path, shell=True, stdout=PIPE, stderr=STDOUT) +output = p.communicate()[0] +live_repo_hash = output.strip() repover.close() live_pkg_hash = ''