Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 210905 Details for
Bug 293859
app-admin/webapp-config-1.50-r3 ignores hooked script's exit status
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against ebuild.py coming with version 1.50.16-r3
test-hooked-script-return-status.patch (text/plain), 2.93 KB, created by
Hugo Mildenberger
on 2009-11-22 17:36:07 UTC
(
hide
)
Description:
Patch against ebuild.py coming with version 1.50.16-r3
Filename:
MIME Type:
Creator:
Hugo Mildenberger
Created:
2009-11-22 17:36:07 UTC
Size:
2.93 KB
patch
obsolete
>--- a/WebappConfig/ebuild.py 2006-12-30 19:38:36.000000000 +0100 >+++ b/WebappConfig/ebuild.py 2009-11-22 18:12:55.000000000 +0100 >@@ -24,6 +24,9 @@ > > import os.path, re, pwd, grp > >+from os import strerror >+from subprocess import PIPE, Popen >+from multiprocessing import Pipe > from WebappConfig.debug import OUT > import WebappConfig.wrapper as wrapper > from WebappConfig.sandbox import Sandbox >@@ -93,6 +96,21 @@ > > ''' > >+ class HookedScriptError(Exception): >+ ''' Exception thrown when a hook script fails ''' >+ >+ def __init__(self, script, errno): >+ self.errno = errno >+ self.script= script >+ >+ def __str__(self): >+ cmd = "'" + self.script + "'" >+ if self.errno < 0: >+ return cmd + " was terminated by signal " + repr(-self.errno) >+ else: >+ return cmd + " terminated with error status " + repr(self.errno) >+ >+ > def __init__(self, config): > > self.__root = wrapper.get_root() >@@ -130,23 +148,32 @@ > os.access(self.__hooksd + '/' + x, os.X_OK)): > > OUT.debug('Running hook script', 7) >- >- fi, fo, fe = os.popen3(self.__hooksd + '/' + x + ' ' >- + type) >- fi.close() >- result_lines = fo.readlines() >- error_lines = fe.readlines() >- fo.close() >- fe.close() >- >- if result_lines: >- for i in result_lines: >- OUT.notice(i) >- >- if error_lines: >- for i in error_lines: >- OUT.warn(i) >- >+ cmd = self.__hooksd + '/' + x + ' '+ type >+ try: >+ p = Popen(cmd,shell=True,bufsize=1,stdin=None, >+ stdout=PIPE,stderr=PIPE,close_fds=True, >+ universal_newlines=True) >+ >+ (fo,fe) = p.communicate() >+ >+ if fo: >+ OUT.notice(fo) >+ >+ if fe and p.returncode != 0: >+ OUT.error(fe) >+ else: >+ OUT.warn(fe) >+ >+ if p.returncode: >+ raise Ebuild.HookedScriptError(cmd, p.returncode) >+ >+ except Exception, e: >+ sandbox.stop() >+ # remove OUT.die when WebAppConfig finally >+ # provides at least a catch-all exception handler >+ # OUT.error(e) >+ OUT.die(e) >+ raise > sandbox.stop() > > def show_post(self, filename, ptype, server = None):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 293859
: 210905