This fixes a DeepSource alert:
Branches of the `if` statement have similar implementation
For the highlighted `if` statements, all the `elif`/`else` branches have
the same body as `if`. It is recommended to refactor this snippet.
If the if-chain is performing the same action in every case, it shouldn't
be used there at all.
Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
msg += '\npolicy:%s\nstatus:' % policy
if 'Unsupported' in policy or 'Deny' in policy:
msg += 'NOTOK\nerror:Unknown error'
- elif 'Required' in policy:
- msg += 'OK\n'
else:
- # Default action
+ # Default action, including 'Required'
msg += 'OK\n'
return encode_0ce7(msg.encode(), MSG_POLICY)