parameters: (self, host: str, addr: Optional[str] = None)
return_statement: return 0, '%s (%s) ok' % (host, addr), '\n'.join(err)
docstring: Prepare a remote host for use with cephadm
docstring_summary: Prepare a remote host for use with cephadm
docstring_tokens: Prepare a remote host for use with cephadm
function: def _prepare_host(self, host: str, addr: Optional[str] = None) -> Tuple[int, str, str]:
          """Prepare a remote host for use with cephadm"""
          out, err, code = self.wait_async(CephadmServe(self)._run_cephadm(host, cephadmNoImage, 'prepare-host',
                                                                           ['--expect-hostname', host],
                                                                           addr=addr,
                                                                           error_ok=True, no_fsid=True))
          if code:
              return 1, '', ('prepare-host failed:\n' + '\n'.join(err))
          # if we have an outstanding health alert for this host, give the
          # serve thread a kick
          if 'CEPHADM_HOST_CHECK_FAILED' in self.health_checks:
              for item in self.health_checks['CEPHADM_HOST_CHECK_FAILED']['detail']:
                  if item.startswith('host %s ' % host):
                      self.event.set()
          return 0, '%s (%s) ok' % (host, addr), '\n'.join(err)
function_tokens: def _prepare_host ( self , host : str , addr : Optional [ str ] = None ) -> Tuple [ int , str , str ] : out , err , code = self . wait_async ( CephadmServe ( self ) . _run_cephadm ( host , cephadmNoImage , 'prepare-host' , [ '--expect-hostname' , host ] , addr = addr , error_ok = True , no_fsid = True ) ) if code : return 1 , '' , ( 'prepare-host failed:\n' + '\n' . join ( err ) ) # if we have an outstanding health alert for this host, give the # serve thread a kick if 'CEPHADM_HOST_CHECK_FAILED' in self . health_checks : for item in self . health_checks [ 'CEPHADM_HOST_CHECK_FAILED' ] [ 'detail' ] : if item . startswith ( 'host %s ' % host ) : self . event . set ( ) return 0 , '%s (%s) ok' % ( host , addr ) , '\n' . join ( err )