summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 09:39:12 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 09:39:12 -0700
commitec7aeebce20e6a71a6de0e1323b1311d5f160d56 (patch)
tree43b5ff99170cb7ff3b1e6f0fe697cec3e8c1ecf1 /cloudinit
parent5395081ce719471dc1101feaf310417457ae5261 (diff)
downloadvyos-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__.py7
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