~ubuntu-branches/ubuntu/wily/heat/wily-proposed

« back to all changes in this revision

Viewing changes to heat/engine/constraints.py

  • Committer: Package Import Robot
  • Author(s): James Page, Corey Bryant, James Page
  • Date: 2015-03-30 11:11:18 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20150330111118-2qpycylx6swu4yhj
Tags: 2015.1~b3-0ubuntu1
[ Corey Bryant ]
* New upstream milestone release for OpenStack kilo:
  - d/control: Align with upstream dependencies.
  - d/p/sudoers_patch.patch: Rebased.
  - d/p/fix-requirements.patch: Rebased.

[ James Page ]
* d/p/fixup-assert-regex.patch: Tweak test to use assertRegexpMatches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
import numbers
16
16
import re
17
17
 
18
 
from oslo.utils import strutils
 
18
from oslo_utils import strutils
19
19
import six
20
20
 
21
21
from heat.common import exception
244
244
        self.value = value
245
245
 
246
246
    def __getitem__(self, key):
247
 
        if key != self.ANYTHING and not isinstance(key, (int, long)):
 
247
        if key != self.ANYTHING and not isinstance(key, six.integer_types):
248
248
            raise KeyError(_('Invalid key %s') % str(key))
249
249
 
250
250
        return self.value
333
333
        self.max = max
334
334
 
335
335
        for param in (min, max):
336
 
            if not isinstance(param, (float, int, long, type(None))):
 
336
            if not isinstance(param, (float, six.integer_types, type(None))):
337
337
                raise exception.InvalidSchemaError(
338
338
                    message=_('min/max must be numeric'))
339
339
 
402
402
        super(Length, self).__init__(min, max, description)
403
403
 
404
404
        for param in (min, max):
405
 
            if not isinstance(param, (int, long, type(None))):
 
405
            if not isinstance(param, (six.integer_types, type(None))):
406
406
                msg = _('min/max length must be integral')
407
407
                raise exception.InvalidSchemaError(message=msg)
408
408