[elbe-devel] [PATCH 46/75] daemons soap authentication: Fix Pylint
Torben Hohn
torben.hohn at linutronix.de
Tue Jun 2 09:45:15 CEST 2020
On Fri, May 29, 2020 at 04:42:54PM -0400, Olivier Dion wrote:
> On Fri, 29 May 2020, Olivier Dion <dion at linutronix.de> wrote:
> > On Fri, 29 May 2020, Torben Hohn <torben.hohn at linutronix.de> wrote:
> >> On Mon, May 25, 2020 at 11:42:39AM -0400, Olivier Dion wrote:
> >>> 23:4: R1705: (no-else-return)
> >>> 106:4: R1705: (no-else-return)
> >>>
> >>> Signed-off-by: Olivier Dion <dion at linutronix.de>
> >>
> >> dont ignore it, remove the else
> >
> > What about:
> > ----------------------------------------------------------------------
> > @wraps(func)
> > def wrapped(self, *args):
> > s = self.transport.req_env['beaker.session']
> > try:
> > uid = s['userid']
> > except KeyError:
> > raise SoapElbeNotLoggedIn()
> >
> > return func(self, uid, *args)
> > return wrapped
> > ----------------------------------------------------------------------
> >
> > and:
> > ----------------------------------------------------------------------
> > @wraps(func)
> > def wrapped(self, *args):
> > s = self.transport.req_env['beaker.session']
> > try:
> > uid = s['userid']
> > except KeyError:
> > raise SoapElbeNotLoggedIn()
> >
> > if not self.app.pm.db.is_admin(uid):
> > raise SoapElbeNotAuthorized()
> > return func(self, *args)
> > return wrapped
> > ----------------------------------------------------------------------
>
> Err nvm. That spyne crap is a real mess.
yup. but maybe we can separate the argcount confusion of the spynecrap
from the actual implementation, the use *args like you do above, and
just wrap that with some other decorator, that fixes the argcount.
But i guess, we are better off with just a comment, which prevents
us from forgetting, that this can not be done with *args in an easy
way.
Lets not invest too much time in this.
>
> --
> Olivier Dion
> Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list