diff options
Diffstat (limited to 'MgaRepo/cgi/soapserver.py')
-rw-r--r-- | MgaRepo/cgi/soapserver.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/MgaRepo/cgi/soapserver.py b/MgaRepo/cgi/soapserver.py index a203940..2fdbe0b 100644 --- a/MgaRepo/cgi/soapserver.py +++ b/MgaRepo/cgi/soapserver.py @@ -18,28 +18,28 @@ class SoapIface: username = os.environ.get("REMOTE_USER") packager = config.get("users", username) if not packager: - raise CgiError, "your email was not found" + raise CgiError("your email was not found") elif not packagerev: - raise CgiError, "no revision provided" + raise CgiError("no revision provided") elif not targetname: - raise CgiError, "no target provided" + raise CgiError("no target provided") else: targetname = targetname.lower() for target in get_targets(): if target.name.lower() == targetname: break else: - raise CgiError, "target not found" + raise CgiError("target not found") try: tmp = int(packagerev) except ValueError: - raise CgiError, "invalid revision provided" + raise CgiError("invalid revision provided") for allowed in target.allowed: if packageurl.startswith(allowed): break else: - raise CgiError, "%s is not allowed for this target" \ - % packageurl + raise CgiError("%s is not allowed for this target" \ + % packageurl) get_srpm(packageurl, revision=packagerev, targetdirs=target.target, @@ -73,10 +73,10 @@ Content-type: text/html def show(msg="", error=0): if error: msg = '<font color="red">%s</font>' % msg - print TEMPLATE % {"message":msg} + print(TEMPLATE % {"message":msg}) def main(): - if not os.environ.has_key('REQUEST_METHOD'): + if 'REQUEST_METHOD' not in os.environ: sys.stderr.write("error: this program is meant to be used as a cgi\n") sys.exit(1) if not NINZ: |