From 852eb60ab9dfc25c22e52518a7ea8bd2ac2932f7 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 23 Jan 2020 11:06:09 -0800 Subject: [PATCH] renamed config service get_text to get_text_template to be more obvious to the purpose --- daemon/core/configservice/base.py | 6 +++--- daemon/core/configservices/simpleservice.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/core/configservice/base.py b/daemon/core/configservice/base.py index 8db4d7f5..bc788a2c 100644 --- a/daemon/core/configservice/base.py +++ b/daemon/core/configservice/base.py @@ -142,7 +142,7 @@ class ConfigService(abc.ABC): def set_template(self, name: str, template: str) -> None: self.custom_templates[name] = template - def get_text(self, name: str) -> str: + def get_text_template(self, name: str) -> str: raise CoreError(f"service({self.name}) unknown template({name})") def get_templates(self) -> Dict[str, str]: @@ -155,7 +155,7 @@ class ConfigService(abc.ABC): elif self.templates.has_template(basename): template = self.templates.get_template(basename).source else: - template = self.get_text(name) + template = self.get_text_template(name) template = self.clean_text(template) templates[name] = template return templates @@ -171,7 +171,7 @@ class ConfigService(abc.ABC): elif self.templates.has_template(basename): rendered = self.render_template(basename, data) else: - text = self.get_text(name) + text = self.get_text_template(name) text = self.clean_text(text) rendered = self.render_text(text, data) logging.info( diff --git a/daemon/core/configservices/simpleservice.py b/daemon/core/configservices/simpleservice.py index ab2dcb5b..3284471d 100644 --- a/daemon/core/configservices/simpleservice.py +++ b/daemon/core/configservices/simpleservice.py @@ -25,7 +25,7 @@ class SimpleService(ConfigService): "mode3": {"value1": "m3", "value2": "m3", "value3": "m3"}, } - def get_text(self, name: str) -> str: + def get_text_template(self, name: str) -> str: if name == "test1.sh": return """ # sample script 1