From ec7aeebce20e6a71a6de0e1323b1311d5f160d56 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 09:39:12 -0700 Subject: 1. Add a constant for the "cc_" prefix, so that it can be easily changed if desired. --- cloudinit/transforms/__init__.py | 7 +++++-- 1 file 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 -- cgit v1.2.3