Stripp leading slash from requirements object_id

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-15 00:26:00 +02:00
parent cba202186e
commit d83de25774

View file

@ -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)