From 1351334be8867b62bf97f75f60a11bc8bce84c8f Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Wed, 26 Sep 2018 12:08:07 +0200 Subject: [PATCH 1/2] Stop using _LE, make heat-engine not die in OpenStack Pike and later "from heat.common.i18n import _LE" can't work in OpenStack releases later than Ocata. Stop using it, and remove the import. Fixes #166 for Pike. --- f5_heat/resources/f5_sys_iappservice.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/f5_heat/resources/f5_sys_iappservice.py b/f5_heat/resources/f5_sys_iappservice.py index b212117..664b686 100644 --- a/f5_heat/resources/f5_sys_iappservice.py +++ b/f5_heat/resources/f5_sys_iappservice.py @@ -18,7 +18,6 @@ from heat.common import exception from heat.common.i18n import _ -from heat.common.i18n import _LE from heat.engine import properties from heat.engine import resource @@ -114,9 +113,7 @@ def _check_iapp_answers(self, prop_name): self.properties[prop_name] ) except Exception: - LOG.error( - _LE("'%s' property failed to parse as JSON") % prop_name - ) + LOG.error("'%s' property failed to parse as JSON" % prop_name) raise def _build_service_dict(self): From 330fa8f52448c5f09ac15dbf035c07acbd8c424c Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Wed, 26 Sep 2018 13:13:15 +0200 Subject: [PATCH 2/2] Silence two flake8 E501 errors flake8 is complaining about 2 "line too long" (E501) errors. Break those lines into two, and fix up the indentation. --- f5_heat/resources/f5_sys_iappcompositetemplate.py | 10 +++++----- f5_heat/resources/f5_sys_iappfulltemplate.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/f5_heat/resources/f5_sys_iappcompositetemplate.py b/f5_heat/resources/f5_sys_iappcompositetemplate.py index 98fffe4..576ec0c 100644 --- a/f5_heat/resources/f5_sys_iappcompositetemplate.py +++ b/f5_heat/resources/f5_sys_iappcompositetemplate.py @@ -150,11 +150,11 @@ def handle_delete(self): partition=self.partition_name ): try: - loaded_template = self.bigip.tm.sys.application.templates.template.\ - load( - name=self.properties[self.NAME], - partition=self.partition_name - ) + templates = self.bigip.tm.sys.application.templates + loaded_template = templates.template.load( + name=self.properties[self.NAME], + partition=self.partition_name + ) loaded_template.delete() except Exception as ex: raise exception.ResourceFailure(ex, None, action='DELETE') diff --git a/f5_heat/resources/f5_sys_iappfulltemplate.py b/f5_heat/resources/f5_sys_iappfulltemplate.py index 75ea472..1ea0665 100644 --- a/f5_heat/resources/f5_sys_iappfulltemplate.py +++ b/f5_heat/resources/f5_sys_iappfulltemplate.py @@ -111,11 +111,11 @@ def handle_delete(self): partition=self.partition_name ): try: - loaded_template = self.bigip.tm.sys.application.templates.template.\ - load( - name=self.template_dict['name'], - partition=self.partition_name - ) + templates = self.bigip.tm.sys.application.templates + loaded_template = templates.template.load( + name=self.template_dict['name'], + partition=self.partition_name + ) loaded_template.delete() except Exception as ex: raise exception.ResourceFailure(ex, None, action='DELETE')