there is chance that self.ssh_user is None when handling "cephadm
get-user" command, so return -ENOENT and error messages in that case.
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
36dde8861a1b8ae0aa53926c773e21bfa065fb07)
"""
Show user for SSHing to cluster hosts
"""
- return 0, self.ssh_user, ''
+ if self.ssh_user is None:
+ return -errno.ENOENT, '', 'No cluster SSH user configured'
+ else:
+ return 0, self.ssh_user, ''
@orchestrator._cli_read_command(
'cephadm set-user')