Merge "Replace (int, long) with six.integer_types"
This commit is contained in:
commit
1f75a46cb4
|
@ -431,7 +431,7 @@ class DbQuotaDriver(object):
|
|||
# Set up the reservation expiration
|
||||
if expire is None:
|
||||
expire = CONF.reservation_expire
|
||||
if isinstance(expire, (int, long)):
|
||||
if isinstance(expire, six.integer_types):
|
||||
expire = datetime.timedelta(seconds=expire)
|
||||
if isinstance(expire, datetime.timedelta):
|
||||
expire = timeutils.utcnow() + expire
|
||||
|
|
|
@ -473,7 +473,9 @@ class NaElement(object):
|
|||
child = NaElement(key)
|
||||
child.add_child_elem(value)
|
||||
self.add_child_elem(child)
|
||||
elif isinstance(value, (str, int, float, long)):
|
||||
elif isinstance(
|
||||
value,
|
||||
six.string_types + six.integer_types + (float, )):
|
||||
self.add_new_child(key, six.text_type(value))
|
||||
elif isinstance(value, (list, tuple, dict)):
|
||||
child = NaElement(key)
|
||||
|
|
Loading…
Reference in New Issue