From bae5d0f8ff6b762071b5a00a18b8d4453652e665 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 22 Mar 2010 16:14:45 +0000 Subject: Client/Tools/__init__.py: Report return value in lower bits of cmdstat The return value was being stored in the upper eight bits of cmdstat. This change shifts that value to the lower bits so that comparisons in calling methods will be reliable. Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5783 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index 33a0e19c1..671c5f01d 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -86,7 +86,10 @@ class executor: cmdstat = runpipe.poll() output += [line[:-1] for line in runpipe.fromchild.readlines() \ if line] - return (cmdstat, output) + # The exit code from the program is in the upper byte of the + # value returned by cmdstat. Shift it down for tools looking at + # the value. + return ((cmdstat >> 8), output) class Tool: ''' -- cgit v1.2.3-1-g7c22