summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildstats.bbclass
diff options
context:
space:
mode:
authorStephano Cetola <stephano.cetola@linux.intel.com>2016-09-29 15:50:24 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-01 21:45:56 +0100
commit5d96223e312fe8276ab9684e13cb2af41536e48a (patch)
treec82c83b59a141ee3ce006647df8634574cc25189 /meta/classes/buildstats.bbclass
parent1ab3a237397663cdbffc914b51f086682623c4a3 (diff)
downloadpoky-5d96223e312fe8276ab9684e13cb2af41536e48a.tar.gz
subprocess: remove Popen in favor of check_output
This begins moving away from the deprecated subprocess calls in an effort to eventually move to some more global abstraction using the run convenience method provided in python 3.5. [ YOCTO #9342 ] (From OE-Core rev: 0d6b7276003f1afabc6de683f663540327d52bdc) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildstats.bbclass')
-rw-r--r--meta/classes/buildstats.bbclass6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
index 34ecb03861..8c2b7b3944 100644
--- a/meta/classes/buildstats.bbclass
+++ b/meta/classes/buildstats.bbclass
@@ -163,7 +163,11 @@ python run_buildstats () {
163 bs = os.path.join(bsdir, "build_stats") 163 bs = os.path.join(bsdir, "build_stats")
164 with open(bs, "a") as f: 164 with open(bs, "a") as f:
165 rootfs = d.getVar('IMAGE_ROOTFS', True) 165 rootfs = d.getVar('IMAGE_ROOTFS', True)
166 rootfs_size = subprocess.Popen(["du", "-sh", rootfs], stdout=subprocess.PIPE).stdout.read() 166 try:
167 rootfs_size = subprocess.check_output(["du", "-sh", rootfs],
168 stderr=subprocess.STDOUT).decode('utf-8')
169 except subprocess.CalledProcessError as e:
170 bb.error("Failed to get rootfs size: %s" % e.output)
167 f.write("Uncompressed Rootfs size: %s" % rootfs_size) 171 f.write("Uncompressed Rootfs size: %s" % rootfs_size)
168 172
169 elif isinstance(e, bb.build.TaskFailed): 173 elif isinstance(e, bb.build.TaskFailed):