If we're upgrading from 15.2.0, we may fail to update caps. Instead of
failing the upgrade hard, warn to the log and continue. This is less
than ideal, but the caps will get corrected the next time the daemon is
redeployed on the next upgrade, and most likely the previous caps will
continue to work (given they were presumably working before the upgrade).
Signed-off-by: Sage Weil <sage@newdream.net>
'caps': caps,
})
if err:
- ret, out, err = self.mgr.check_mon_command({
+ ret, out, err = self.mgr.mon_command({
'prefix': 'auth caps',
'entity': entity,
'caps': caps,
})
+ if err:
+ self.mgr.log.warning(f"Unable to update caps for {entity}")
return keyring
def _inventory_get_addr(self, hostname: str) -> str:
def __init__(self):
self.config = ''
self.check_mon_command = MagicMock(side_effect=self._check_mon_command)
+ self.mon_command = MagicMock(side_effect=self._check_mon_command)
self.template = MagicMock()
+ self.log = MagicMock()
def _check_mon_command(self, cmd_dict, inbuf=None):
prefix = cmd_dict.get('prefix')
'caps': expected_caps})
assert expected_call in mgr.check_mon_command.mock_calls
- assert expected_call2 in mgr.check_mon_command.mock_calls
+ assert expected_call2 in mgr.mon_command.mock_calls
def test_get_auth_entity(self):
mgr = FakeMgr()