diff --git a/HACKING.rst b/HACKING.rst index aa93381b..9545a50e 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ heat-translator Style Commandments -=============================================== +================================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ diff --git a/test-requirements.txt b/test-requirements.txt index 8f582893..703ab958 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # 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 # 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 fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 diff --git a/translator/common/utils.py b/translator/common/utils.py index 874c8ec9..8d82d554 100644 --- a/translator/common/utils.py +++ b/translator/common/utils.py @@ -61,10 +61,10 @@ class MemoryUnit(object): result = regex.match(str(size)).groups() if result[1]: unit_size = MemoryUnit.validate_unit(result[1]) - converted = int(str_to_num(result[0]) - * MemoryUnit.UNIT_SIZE_DICT[unit_size] - * math.pow(MemoryUnit.UNIT_SIZE_DICT - [unit], -1)) + converted = int(str_to_num(result[0]) * + MemoryUnit.UNIT_SIZE_DICT[unit_size] * + math.pow(MemoryUnit.UNIT_SIZE_DICT + [unit], -1)) log.info(_('Given size %(size)s is converted to %(num)s ' '%(unit)s.') % {'size': size, 'num': converted, 'unit': unit}) @@ -81,8 +81,8 @@ class MemoryUnit(object): if key.upper() == unit.upper(): return key - msg = _('Provided unit "{0}" is not valid. The valid units are' - ' {1}').format(unit, MemoryUnit.UNIT_SIZE_DICT.keys()) + msg = _('Provided unit "{0}" is not valid. The valid units are ' + '{1}').format(unit, MemoryUnit.UNIT_SIZE_DICT.keys()) log.error(msg) raise ValueError(msg) diff --git a/translator/hot/translate_node_templates.py b/translator/hot/translate_node_templates.py index 1275deef..0a30dfa1 100644 --- a/translator/hot/translate_node_templates.py +++ b/translator/hot/translate_node_templates.py @@ -79,9 +79,9 @@ def _load_classes(locations, classes): abs_path = abs_path.replace('translator/hot', cls_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') - and not f.startswith('__init__') - and f.startswith('tosca_')] + mod_files = [f for f in os.listdir(abs_path) if f.endswith('.py') and + not f.startswith('__init__') and + f.startswith('tosca_')] # For each module, pick out the target translation class for f in mod_files: