From abc364013de96b1ff0170b65665388ed8ca3e07f Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Fri, 20 Feb 2009 21:56:47 +0000 Subject: os.popen is deprecated in 2.6 (http://docs.python.org/library/os.html#os.popen) Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5088 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Git.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/Server/Plugins/Git.py') diff --git a/src/lib/Server/Plugins/Git.py b/src/lib/Server/Plugins/Git.py index 1c17c8e47..6cb089de6 100644 --- a/src/lib/Server/Plugins/Git.py +++ b/src/lib/Server/Plugins/Git.py @@ -1,4 +1,5 @@ import os +from subprocess import Popen, PIPE import Bcfg2.Server.Plugin # for debugging output only @@ -31,8 +32,9 @@ class Git(Bcfg2.Server.Plugin.Plugin, def get_revision(self): '''Read git revision information for the bcfg2 repository''' try: - data = os.popen("env LC_ALL=C git ls-remote %s" % - (self.datastore)).readlines() + data = Popen(("env LC_ALL=C git ls-remote %s" % + (self.datastore)), shell=True, + stdout=PIPE).stdout.readlines() revline = [line.split('\t')[0].strip() for line in data if \ line.split('\t')[1].strip() == 'refs/heads/master'][-1] revision = revline -- cgit v1.2.3-1-g7c22