From d83de257749c7b5d080f8c0bf1fba0496319afd0 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 15 Oct 2011 00:26:00 +0200 Subject: [PATCH] Stripp leading slash from requirements object_id Signed-off-by: Steven Armstrong --- lib/cdist/emulator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cdist/emulator.py b/lib/cdist/emulator.py index 0b303b23..f861dfda 100644 --- a/lib/cdist/emulator.py +++ b/lib/cdist/emulator.py @@ -125,8 +125,10 @@ def run(argv): except IndexError: # no object id, must be singleton requirement_object_id = 'singleton' + # strip leading slash from object_id if requirement_object_id.startswith('/'): - raise IllegalRequirementError(requirement, 'requirements object_id may not start with /') + log.debug("Stripping leading slash from requirements object_id: %s", requirement) + requirement_object_id = requirement_object_id.lstrip('/') log.debug("Recording requirement: %s -> %s" % (cdist_object.path, requirement)) cdist_object.requirements.append(requirement)