Revert "Revert "Fix sysinv handle bmc password cannot be stored case""

This reverts commit f632a4c50b.

Suspected issue already root caused and fixed with below patch
https://review.opendev.org/681805

Closes-Bug: #1834673

Change-Id: Iac904b7cbc81218fc5045559e59ecee1db033df7
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
This commit is contained in:
zhipeng liu 2019-10-14 02:27:20 +00:00
parent f632a4c50b
commit 583f3dd286
2 changed files with 7 additions and 5 deletions

View File

@ -3802,9 +3802,11 @@ class HostController(rest.RestController):
phost['bm_username'])))
if password_exists and patch_bm_password:
pecan.request.rpcapi.create_barbican_secret(pecan.request.context,
phost['uuid'],
patch_bm_password)
if not pecan.request.rpcapi.create_barbican_secret(pecan.request.context,
phost['uuid'],
patch_bm_password):
raise wsme.exc.ClientSideError(
_("%s Rejected: failed to create barbican secret " % phost['hostname']))
LOG.info("%s bm semantic checks for user_agent %s passed" %
(phost['hostname'], pecan.request.user_agent))

View File

@ -8980,8 +8980,8 @@ class ConductorManager(service.PeriodicService):
:param name: secret name
:param payload: secret payload
"""
self._openstack.create_barbican_secret(context=context,
name=name, payload=payload)
return self._openstack.create_barbican_secret(context=context,
name=name, payload=payload)
def delete_barbican_secret(self, context, name):
"""Calls Barbican API to delete a secret