Humh, fair enough. Perhaps simply check that as the first line in your code
since you don't even need to get the client if that's the case?


On Tue, May 21, 2013 at 4:54 PM, nmalzieu <notifications@github.com> wrote:

> In pynagiosplugins/nagios_check_redis.py:
>
> > +    def __init__(
> > +        self,
> > +        redis_key=None,
> > +        **params
> > +    ):
> > +
> > +        self.redis_key = redis_key
> > +
> > +        super(NagiosCheckRedis, self).__init__(**params)
> > +
> > +    def compute(self):
> > +        redis_client = self.redis_connect()
> > +        if self.redis_key:
> > +            return redis_client.get(self.redis_key)
> > +        else:
> > +            raise ValueError('You must define a key to get or override compute method')
>
> but None value IS allowed, if you don't want to just get a key's value but
> want to compute a value from different keys, you don't define redis_key but
> override compute with what you want... That's what I had to do to compute
> values for job pipe's indicators... Do you have a better solution?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Work4Labs/pynagiosplugins/pull/7/files#r4329727>
> .
>