library policy activation to accept item as {}

For activation of library policy , currently item is expected to passed
only as None, but when querying through client None is not accepted as valid
json type, so will be passed as empty dict, so this commit allows
server to accept and validate accordingly.

Change-Id: I9d038dd4c33ed509261f6b404ab278bd33318d3b
This commit is contained in:
Anusha Ramineni 2017-11-09 15:33:12 +05:30 committed by Eric Kao
parent 4c4fcb300f
commit c799988bca
1 changed files with 3 additions and 3 deletions

View File

@ -90,10 +90,10 @@ class PolicyModel(base.APIModel):
"""
# case 1: parameter gives library policy UUID
if 'library_policy' in params:
if item is not None:
if item:
raise exception.BadRequest(
'Policy creation reqest with `library_policy` parameter '
'must not have body.')
'Policy creation request with `library_policy` parameter '
'must not have non-empty body.')
try:
# Note(thread-safety): blocking call
library_policy_object = self.invoke_rpc(