[python-bugzilla] [PATCH] Ensure Bugzilla_token is set when no args present

Cole Robinson crobinso at redhat.com
Thu Apr 24 15:04:38 UTC 2014


On 04/24/2014 01:56 AM, abn at redhat.com wrote:
> From: Arun Babu Neelicattu <abn at redhat.com>
> 
> Thanks to Simon Baird for pointing out the issue.
> ---
>  bugzilla/base.py | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/bugzilla/base.py b/bugzilla/base.py
> index f026709..31cfc51 100644
> --- a/bugzilla/base.py
> +++ b/bugzilla/base.py
> @@ -153,9 +153,12 @@ class _BugzillaServerProxy(ServerProxy):
>          self.token.value = None
>  
>      def _ServerProxy__request(self, methodname, params):
> -        if (self.token.value is not None and len(params) == 1
> -            and 'Bugzilla_token' not in params[0]):
> -            params[0]['Bugzilla_token'] = self.token.value
> +        if self.token.value is not None:
> +            if len(params) == 0:
> +                params = ({}, )
> +
> +            if 'Bugzilla_token' not in params[0]:
> +                params[0]['Bugzilla_token'] = self.token.value
>  
>          # pylint: disable=maybe-no-member
>          ret = ServerProxy._ServerProxy__request(self, methodname, params)
> 

Thanks, pushed.

- Cole


More information about the python-bugzilla mailing list