remove leading / from object_id of requirement

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-15 02:46:28 +02:00
parent a7a3ee6f19
commit 0dd38f75c2

View file

@ -156,8 +156,8 @@ class Emulator(object):
except IndexError:
# no object id, must be singleton
requirement_object_id = 'singleton'
if requirement_object_id.startswith('/'):
raise IllegalRequirementError(requirement, 'requirements object_id may not start with /')
requirement_object_id = requirement_object_id.lstrip('/')
self.log.debug("Recording requirement: %s -> %s" % (self.cdist_object.path, requirement))
self.cdist_object.requirements.append(requirement)