Change in vdsm[master]: properties: Add properties module

nsoffer at redhat.com nsoffer at redhat.com
Fri Dec 11 12:01:03 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: properties: Add properties module
......................................................................


Patch Set 6:

(1 comment)

https://gerrit.ovirt.org/#/c/40822/6/lib/vdsm/properties.py
File lib/vdsm/properties.py:

Line 141: class _Number(Property):
Line 142: 
Line 143:     def __init__(self, required=False, default=None, doc=None, minval=None,
Line 144:                  maxval=None):
Line 145:         if minval is not None and default is not None and default < minval:
> We have bunch of the same checks. It would be good to have single method wh
I see 2 places - checking minval and maxval with default. This check is very similar but has different check (< or >) and different log message. Can you show me an example of doing this check in a more clear way?
Line 146:             raise ValueError("Invalid default %s < %s" % (default, minval))
Line 147:         if maxval is not None and default is not None and default > maxval:
Line 148:             raise ValueError("Invalid default %s > %s" % (default, maxval))
Line 149:         super(_Number, self).__init__(required=required, default=default,


-- 
To view, visit https://gerrit.ovirt.org/40822
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I62175172dddce7f84319e3c8669747994e06a697
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list