forked from ungleich-public/cdist
Stripp leading slash from requirements object_id
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
cba202186e
commit
d83de25774
1 changed files with 3 additions and 1 deletions
|
@ -125,8 +125,10 @@ def run(argv):
|
||||||
except IndexError:
|
except IndexError:
|
||||||
# no object id, must be singleton
|
# no object id, must be singleton
|
||||||
requirement_object_id = 'singleton'
|
requirement_object_id = 'singleton'
|
||||||
|
# strip leading slash from object_id
|
||||||
if requirement_object_id.startswith('/'):
|
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))
|
log.debug("Recording requirement: %s -> %s" % (cdist_object.path, requirement))
|
||||||
cdist_object.requirements.append(requirement)
|
cdist_object.requirements.append(requirement)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue