Change checks for handling same layer name un different stack

This commit is contained in:
Loukas Leontopoulos 2017-09-25 14:49:08 +03:00
parent 7599fd5dc0
commit 4393a4f76c
2 changed files with 5 additions and 5 deletions

View File

@ -422,11 +422,11 @@ class OpsWorksBackend(BaseBackend):
stackid = kwargs['stack_id']
if stackid not in self.stacks:
raise ResourceNotFoundException(stackid)
if name in [l.name for l in self.layers.values()]:
if name in [l.name for l in self.stacks[stackid].layers]:
raise ValidationException(
'There is already a layer named "{0}" '
'for this stack'.format(name))
if shortname in [l.shortname for l in self.layers.values()]:
if shortname in [l.shortname for l in self.stacks[stackid].layers]:
raise ValidationException(
'There is already a layer with shortname "{0}" '
'for this stack'.format(shortname))