[Trivial Fix] Add document layer to error message output

The document layer that is invalid should be included in
the exception called InvalidDocumentLayer for obvious reasons.

Change-Id: Ie7fcecc96bc7667530959af34ec146b4e4a47303
This commit is contained in:
Felipe Monteiro 2018-02-14 22:59:27 -05:00
parent 113365f552
commit 99ab93727b
2 changed files with 5 additions and 3 deletions

View File

@ -303,6 +303,7 @@ class DocumentLayering(object):
document.schema, document.name,
self._layering_policy.layer_order)
raise errors.InvalidDocumentLayer(
document_layer=document.layer,
document_schema=document.schema,
document_name=document.name,
layer_order=', '.join(

View File

@ -187,9 +187,10 @@ class InvalidDocumentLayer(DeckhandException):
* Check that the document layer is contained in the layerOrder in the
registered LayeringPolicy in the system.
"""
msg_fmt = ("Invalid layer for document [%(document_schema)s] "
"%(document_name)s was not found in layerOrder %(layer_order)s "
"for provided LayeringPolicy %(layering_policy_name)s.")
msg_fmt = ("Invalid layer '%(document_layer)s' for document "
"[%(document_schema)s] %(document_name)s was not found in "
"layerOrder: %(layer_order)s for provided LayeringPolicy: "
"%(layering_policy_name)s.")
code = 400