Closed nazunalika closed 3 years ago
@nazunalika hi, thanks for the new PR!
Strange errors.. As i can see there can be some issues with this https://stackoverflow.com/questions/15170676/cannot-import-jsondecodeerror.
Let's try to change JSONDecodeError
to ValueError
. If it doesn't help, to just except Exception
?
I think it should be also fine.
Ah, i see now.. First please try to put json.decoder.JSONDecodeError
instead JSONDecodeError
, then, if doesn't help, what i suggested above. Thanks!
@nazunalika thanks! Green now! Does this solve your problem locally? If yes, can we merge the PR?
cc @odyssey4me
@nazunalika thanks for your contribution (bugfix + tests)! I think now we can release the collection even tomorrow, not on Friday as was planned. Please take a look at the open issues and pull requests. Any help will be much appreciated!
@odyssey4me thanks for reviewing and approving!
Redoing PR based on feedback in #58
SUMMARY
Fixes #28 by trying to load with
json.loads
and if unable, to assigntags
without loading as json.ISSUE TYPE
COMPONENT NAME
rabbitmq_policy
ADDITIONAL INFORMATION
During the
_policy_check
piece of this module,policy_data
is basically a list based on a split of the variablepolicy
. However,policy
does not contain data. As a result of the split, it becomes:['vhost', 'name', 'pattern', 'apply-to', 'definition', 'priority']
As there is no JSON data, there is no reason to use
json.loads
on a string.To reproduce this issue: