parameters: (
              self,
              entity: str,
              placement: str,
              owner: Optional[str] = None,
              mode: Optional[str] = None,
      )
return_statement: return HandleCommandResult()
docstring: Add or update client keyring under cephadm management
docstring_summary: Add or update client keyring under cephadm management
docstring_tokens: Add or update client keyring under cephadm management
function: def _client_keyring_set(
              self,
              entity: str,
              placement: str,
              owner: Optional[str] = None,
              mode: Optional[str] = None,
      ) -> HandleCommandResult:
          """
          Add or update client keyring under cephadm management
          """
          if not entity.startswith('client.'):
              raise OrchestratorError('entity must start with client.')
          if owner:
              try:
                  uid, gid = map(int, owner.split(':'))
              except Exception:
                  raise OrchestratorError('owner must look like "<uid>:<gid>", e.g., "0:0"')
          else:
              uid = 0
              gid = 0
          if mode:
              try:
                  imode = int(mode, 8)
              except Exception:
                  raise OrchestratorError('mode must be an octal mode, e.g. "600"')
          else:
              imode = 0o600
          pspec = PlacementSpec.from_string(placement)
          ks = ClientKeyringSpec(entity, pspec, mode=imode, uid=uid, gid=gid)
          self.keys.update(ks)
          self._kick_serve_loop()
          return HandleCommandResult()
function_tokens: def _client_keyring_set ( self , entity : str , placement : str , owner : Optional [ str ] = None , mode : Optional [ str ] = None , ) -> HandleCommandResult : if not entity . startswith ( 'client.' ) : raise OrchestratorError ( 'entity must start with client.' ) if owner : try : uid , gid = map ( int , owner . split ( ':' ) ) except Exception : raise OrchestratorError ( 'owner must look like "<uid>:<gid>", e.g., "0:0"' ) else : uid = 0 gid = 0 if mode : try : imode = int ( mode , 8 ) except Exception : raise OrchestratorError ( 'mode must be an octal mode, e.g. "600"' ) else : imode = 0o600 pspec = PlacementSpec . from_string ( placement ) ks = ClientKeyringSpec ( entity , pspec , mode = imode , uid = uid , gid = gid ) self . keys . update ( ks ) self . _kick_serve_loop ( ) return HandleCommandResult ( )