Replace os.popen with subprocess.Popen since the older function would
fail (more or less) silently if the executed program cannot be found
More info:
http://docs.python.org/library/subprocess.html#subprocess-replacements
[YOCTO #2454]
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
import shutil
from tags import *
import glob
+import subprocess
def find_bblayers(scripts_path):
print "Getting branches from remote repo %s..." % giturl
gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl)
- tmp = os.popen(gitcmd).read()
+ tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read()
branches = []
print "Getting branches from remote repo %s..." % giturl
gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl)
- tmp = os.popen(gitcmd).read()
+ tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read()
branches = []