Merge "Update hacking version"

This commit is contained in:
Zuul 2019-02-11 15:14:16 +00:00 committed by Gerrit Code Review
commit 66ce5cf926
4 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
heat-translator Style Commandments heat-translator Style Commandments
=============================================== ==================================
Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

View File

@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order # The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0

View File

@ -61,10 +61,10 @@ class MemoryUnit(object):
result = regex.match(str(size)).groups() result = regex.match(str(size)).groups()
if result[1]: if result[1]:
unit_size = MemoryUnit.validate_unit(result[1]) unit_size = MemoryUnit.validate_unit(result[1])
converted = int(str_to_num(result[0]) converted = int(str_to_num(result[0]) *
* MemoryUnit.UNIT_SIZE_DICT[unit_size] MemoryUnit.UNIT_SIZE_DICT[unit_size] *
* math.pow(MemoryUnit.UNIT_SIZE_DICT math.pow(MemoryUnit.UNIT_SIZE_DICT
[unit], -1)) [unit], -1))
log.info(_('Given size %(size)s is converted to %(num)s ' log.info(_('Given size %(size)s is converted to %(num)s '
'%(unit)s.') % {'size': size, '%(unit)s.') % {'size': size,
'num': converted, 'unit': unit}) 'num': converted, 'unit': unit})
@ -81,8 +81,8 @@ class MemoryUnit(object):
if key.upper() == unit.upper(): if key.upper() == unit.upper():
return key return key
msg = _('Provided unit "{0}" is not valid. The valid units are' msg = _('Provided unit "{0}" is not valid. The valid units are '
' {1}').format(unit, MemoryUnit.UNIT_SIZE_DICT.keys()) '{1}').format(unit, MemoryUnit.UNIT_SIZE_DICT.keys())
log.error(msg) log.error(msg)
raise ValueError(msg) raise ValueError(msg)

View File

@ -79,9 +79,9 @@ def _load_classes(locations, classes):
abs_path = abs_path.replace('translator/hot', cls_path) abs_path = abs_path.replace('translator/hot', cls_path)
# Grab all the tosca type module files in the given path # Grab all the tosca type module files in the given path
mod_files = [f for f in os.listdir(abs_path) if f.endswith('.py') mod_files = [f for f in os.listdir(abs_path) if f.endswith('.py') and
and not f.startswith('__init__') not f.startswith('__init__') and
and f.startswith('tosca_')] f.startswith('tosca_')]
# For each module, pick out the target translation class # For each module, pick out the target translation class
for f in mod_files: for f in mod_files: