Merge remote-tracking branch 'steven/master'
This commit is contained in:
commit
4d4287c580
8 changed files with 83 additions and 20 deletions
|
|
@ -92,9 +92,10 @@ class Manifest(object):
|
|||
env = os.environ.copy()
|
||||
env.update(self.env)
|
||||
env.update({
|
||||
'__self': cdist_object.name,
|
||||
'__object': cdist_object.absolute_path,
|
||||
'__object_id': cdist_object.object_id,
|
||||
'__object_fq': cdist_object.path,
|
||||
'__object_fq': cdist_object.name,
|
||||
'__type': cdist_object.type.absolute_path,
|
||||
'__cdist_manifest': script,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -88,8 +88,11 @@ class Object(object):
|
|||
return self.__class__(self.type.__class__(type_path, type_name), object_path, object_id=object_id)
|
||||
|
||||
def __init__(self, cdist_type, base_path, object_id=None):
|
||||
if object_id and object_id.startswith('/'):
|
||||
raise IllegalObjectIdError(object_id, 'object_id may not start with /')
|
||||
if object_id:
|
||||
if object_id.startswith('/'):
|
||||
raise IllegalObjectIdError(object_id, 'object_id may not start with /')
|
||||
if '.cdist' in object_id:
|
||||
raise IllegalObjectIdError(object_id, 'object_id may not contain \'.cdist\'')
|
||||
self.type = cdist_type # instance of Type
|
||||
self.base_path = base_path
|
||||
self.object_id = object_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue