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 <nsof...@redhat.com> Gerrit-Reviewer: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches