parameters: (ctx, remote, socket_path, command, args)
docstring: Run an admin socket command and return the result as a string.
  
      :param ctx: Context
      :param remote: Remote site
      :param socket_path: path to socket
      :param command: command to be run remotely
      :param args: command arguments
  
      :returns: output of command in json format
docstring_summary: Run an admin socket command and return the result as a string.
docstring_tokens: Run an admin socket command and return the result as a string .
function: def _socket_command(ctx, remote, socket_path, command, args):
      """
      Run an admin socket command and return the result as a string.
  
      :param ctx: Context
      :param remote: Remote site
      :param socket_path: path to socket
      :param command: command to be run remotely
      :param args: command arguments
  
      :returns: output of command in json format
      """
      testdir = teuthology.get_testdir(ctx)
      max_tries = 120
      sub_commands = [c.strip() for c in command.split('||')]
      ex = None
      for _ in range(max_tries):
          for sub_command in sub_commands:
              try:
                  out = remote.sh([
                      'sudo',
                      'adjust-ulimits',
                      'ceph-coverage',
                      '{tdir}/archive/coverage'.format(tdir=testdir),
                      'ceph',
                      '--admin-daemon', socket_path,
                      ] + sub_command.split(' ') + args)
              except CommandFailedError as e:
                  ex = e
                  log.info('ceph cli "%s" returned an error %s, '
                           'command not registered yet?', sub_command, e)
              else:
                  log.debug('admin socket command %s returned %s',
                            sub_command, out)
                  return json.loads(out)
          else:
              # exhausted all commands
              log.info('sleeping and retrying ...')
              time.sleep(1)
      else:
          # i tried max_tries times..
          assert ex is not None
          raise ex
function_tokens: def _socket_command ( ctx , remote , socket_path , command , args ) : testdir = teuthology . get_testdir ( ctx ) max_tries = 120 sub_commands = [ c . strip ( ) for c in command . split ( '||' ) ] ex = None for _ in range ( max_tries ) : for sub_command in sub_commands : try : out = remote . sh ( [ 'sudo' , 'adjust-ulimits' , 'ceph-coverage' , '{tdir}/archive/coverage' . format ( tdir = testdir ) , 'ceph' , '--admin-daemon' , socket_path , ] + sub_command . split ( ' ' ) + args ) except CommandFailedError as e : ex = e log . info ( 'ceph cli "%s" returned an error %s, ' 'command not registered yet?' , sub_command , e ) else : log . debug ( 'admin socket command %s returned %s' , sub_command , out ) return json . loads ( out ) else : # exhausted all commands log . info ( 'sleeping and retrying ...' ) time . sleep ( 1 ) else : # i tried max_tries times.. assert ex is not None raise ex