From f0d9274b4bb6a3f6917d04433d3c51d19cf9a442 Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Mon, 3 Mar 2014 22:29:14 +0200 Subject: [PATCH] Minor refactoring for constant Renames _part_handler_content_type to _PART_HANDLER_CONTENT_TYPE. --- cloudbaseinit/plugins/windows/userdata.py | 4 ++-- cloudbaseinit/tests/plugins/windows/test_userdata.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudbaseinit/plugins/windows/userdata.py b/cloudbaseinit/plugins/windows/userdata.py index dda80958..a2bc5386 100644 --- a/cloudbaseinit/plugins/windows/userdata.py +++ b/cloudbaseinit/plugins/windows/userdata.py @@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__) class UserDataPlugin(base.BasePlugin): - _part_handler_content_type = "text/part-handler" + _PART_HANDLER_CONTENT_TYPE = "text/part-handler" _GZIP_MAGIC_NUMBER = '\x1f\x8b' def execute(self, service, shared_data): @@ -99,7 +99,7 @@ class UserDataPlugin(base.BasePlugin): LOG.debug("Executing userdata plugin: %s" % user_data_plugin.__class__.__name__) - if content_type == self._part_handler_content_type: + if content_type == self._PART_HANDLER_CONTENT_TYPE: new_user_handlers = user_data_plugin.process(part) self._add_part_handlers(user_data_plugins, user_handlers, diff --git a/cloudbaseinit/tests/plugins/windows/test_userdata.py b/cloudbaseinit/tests/plugins/windows/test_userdata.py index 787fb9ba..892dfacc 100644 --- a/cloudbaseinit/tests/plugins/windows/test_userdata.py +++ b/cloudbaseinit/tests/plugins/windows/test_userdata.py @@ -135,7 +135,7 @@ class UserDataPluginTest(unittest.TestCase): mock_user_handlers.get.side_effect = [handler_func] mock_user_data_plugins.get.side_effect = [user_data_plugin] if content_type: - _content_type = self._userdata._part_handler_content_type + _content_type = self._userdata._PART_HANDLER_CONTENT_TYPE mock_part.get_content_type.return_value = _content_type else: _content_type = 'other content type'