1- Pass caps to 'auth get-or-create'
2- Only try 'auth caps' if the get-or-create failed
Note that the 'auth caps' step can fail if upgrading from 15.2.0 since
'profile mgr' didn't include 'auth caps' until 15.2.1. We're not
addressing that for now...
Fixes: 7c0d532f3a4839f4199a13773fb5fa8b6fb3f183
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit
6127d7f20bc8a6ad02d8ea144584eaf2bfc9590e)
ret, keyring, err = self.mgr.check_mon_command({
'prefix': 'auth get-or-create',
'entity': entity,
- })
- ret, out, err = self.mgr.check_mon_command({
- 'prefix': 'auth caps',
- 'entity': entity,
'caps': caps,
})
+ if err:
+ ret, out, err = self.mgr.check_mon_command({
+ 'prefix': 'auth caps',
+ 'entity': entity,
+ 'caps': caps,
+ })
return keyring
def _inventory_get_addr(self, hostname: str) -> str:
'osd', 'allow rwx']
expected_call = call({'prefix': 'auth get-or-create',
- 'entity': 'client.iscsi.a'})
+ 'entity': 'client.iscsi.a',
+ 'caps': expected_caps})
expected_call2 = call({'prefix': 'auth caps',
'entity': 'client.iscsi.a',
'caps': expected_caps})