diff options
author | Joshua Harlow <harlowja@gmail.com> | 2013-07-21 09:26:44 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@gmail.com> | 2013-07-21 09:26:44 -0700 |
commit | 7022512f3ceb955be2834844f05d4683f78ff276 (patch) | |
tree | 221822e3510d36c2e1ebbab142394b5bfe241ce2 /cloudinit/handlers/cloud_config.py | |
parent | 1edfb2a7a36a2bdddfe0ca48ba5d23721bf17a35 (diff) | |
download | vyos-cloud-init-7022512f3ceb955be2834844f05d4683f78ff276.tar.gz vyos-cloud-init-7022512f3ceb955be2834844f05d4683f78ff276.zip |
Use constants for repeated type strings.
Diffstat (limited to 'cloudinit/handlers/cloud_config.py')
-rw-r--r-- | cloudinit/handlers/cloud_config.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/handlers/cloud_config.py b/cloudinit/handlers/cloud_config.py index c97ca3e8..730672d7 100644 --- a/cloudinit/handlers/cloud_config.py +++ b/cloudinit/handlers/cloud_config.py @@ -49,6 +49,7 @@ MERGE_HEADER = 'Merge-Type' # # This gets loaded into yaml with final result {'a': 22} DEF_MERGERS = mergers.string_extract_mergers('dict(replace)+list()+str()') +CLOUD_PREFIX = "#cloud-config" class CloudConfigPartHandler(handlers.Handler): @@ -60,7 +61,7 @@ class CloudConfigPartHandler(handlers.Handler): def list_types(self): return [ - handlers.type_from_starts_with("#cloud-config"), + handlers.type_from_starts_with(CLOUD_PREFIX), ] def _write_cloud_config(self): @@ -78,7 +79,7 @@ class CloudConfigPartHandler(handlers.Handler): if self.cloud_buf is not None: # Something was actually gathered.... lines = [ - "#cloud-config", + CLOUD_PREFIX, '', ] lines.extend(file_lines) |