Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
kls = ResourceType.resources[typename]
except KeyError:
raise error.ParseError(
"There is no resource type of '%s'" % typename, anchor=instance.anchor)
resource = kls(instance)
if resource.id in self:
raise error.ParseError(
"'%s' cannot be defined multiple times" % resource.id, anchor=instance.anchor)
self[resource.id] = resource
# Create implicit File[] nodes for any watched files
try:
for watched in resource.watch:
res = bind({
"name": watched,
"policy": "watched",
})
res.parent = instance
w = self.add("File", res)
w._original_hash = None
except errors.NoMatching:
pass
return resource