diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 09:39:12 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-16 09:39:12 -0700 |
commit | ec7aeebce20e6a71a6de0e1323b1311d5f160d56 (patch) | |
tree | 43b5ff99170cb7ff3b1e6f0fe697cec3e8c1ecf1 /cloudinit | |
parent | 5395081ce719471dc1101feaf310417457ae5261 (diff) | |
download | vyos-cloud-init-ec7aeebce20e6a71a6de0e1323b1311d5f160d56.tar.gz vyos-cloud-init-ec7aeebce20e6a71a6de0e1323b1311d5f160d56.zip |
1. Add a constant for the "cc_" prefix, so that it can be easily changed if desired.
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/transforms/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/transforms/__init__.py b/cloudinit/transforms/__init__.py index 2460f316..391a916e 100644 --- a/cloudinit/transforms/__init__.py +++ b/cloudinit/transforms/__init__.py @@ -25,6 +25,9 @@ from cloudinit import log as logging LOG = logging.getLogger(__name__) +# TODO remove this from being a prefix?? +TRANSFORM_PREFIX = "cc_" + def form_transform_name(name): canon_name = name.replace("-", "_") @@ -33,8 +36,8 @@ def form_transform_name(name): canon_name = canon_name.strip() if not canon_name: return None - if not canon_name.startswith("cc_"): - canon_name = 'cc_%s' % (canon_name) + if not canon_name.startswith(TRANSFORM_PREFIX): + canon_name = '%s%s' % (TRANSFORM_PREFIX, canon_name) return canon_name |