~ubuntu-branches/ubuntu/trusty/heat/trusty-security

« back to all changes in this revision

Viewing changes to heat/engine/parameters.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-10-12 16:53:03 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20131012165303-0sc41ujl3luuu56q
Tags: 2013.2~rc2-0ubuntu1
New upstream release candidate (LP: #1239156).

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
 
216
216
    def __int__(self):
217
217
        '''Return an integer representation of the parameter'''
218
 
        return int(self.value())
 
218
        return int(super(NumberParam, self).value())
219
219
 
220
220
    def __float__(self):
221
221
        '''Return a float representation of the parameter'''
222
 
        return float(self.value())
 
222
        return float(super(NumberParam, self).value())
223
223
 
224
224
    def validate(self, val):
225
225
        self.schema.validate(self.name, val)
226
226
 
 
227
    def value(self):
 
228
        try:
 
229
            return int(self)
 
230
        except ValueError:
 
231
            return float(self)
 
232
 
227
233
 
228
234
class StringParam(Parameter):
229
235
    '''A template parameter of type "String".'''