From 16e577475d8953cfb4f2756d0a5d3b399ac4fe6f Mon Sep 17 00:00:00 2001 Message-Id: <16e577475d8953cfb4f2756d0a5d3b399ac4fe6f.1714865453.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 28 Mar 2013 00:02:38 +0000 Subject: [PATCH] agpl.py (filez): Check the exit code from the command. Organization: Straylight/Edgeware From: Mark Wooding --- agpl.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/agpl.py b/agpl.py index 41ee376..b49153b 100644 --- a/agpl.py +++ b/agpl.py @@ -149,6 +149,15 @@ def filez(cmd): ## Whatever's left over will be dealt with next time through. left = buf[i:] + ## Make sure the command actually completed successfully. + if kid.wait(): + rc = kid.returncode + raise U.ExpectedError, \ + (500, "lister command `%s' failed (%s) in `%s'" % ( + cmd, + (rc & 0xff00) and 'rc = %d' % (rc >> 8) or 'signal %d' % rc, + dir)) + ## If there's trailing junk left over then we should complain. if left: raise U.ExpectedError, \ -- [mdw]