'Execute the given command, taken as an argv list.
:param command: command to execute as a list.  if any item is
WORKING_DIRECTORY, the absolute path to the working directory
will be substituted for it.
:param working_directory: directory in which the pidfile will be written
:param pidfile_name: name of the pidfile this process will write
:param num_processes: number of processes to account for from this
execution
:param log_file (optional): path (in the results repository) to hold
command output.
:param paired_with_pidfile (optional): a PidfileId for an
already-executed process; the new process will execute on the
same drone as the previous process.
:param username (optional): login of the user responsible for this
process.
:param drone_hostnames_allowed (optional): hostnames of the drones that
this command is allowed to
execute on'

def execute_command(self, command, working_directory, pidfile_name, num_processes, log_file=None, paired_with_pidfile=None, username=None, drone_hostnames_allowed=None):

    abs_working_directory = self.absolute_path(working_directory)
    if (not log_file):
        log_file = self.get_temporary_path('execute')
    log_file = self.absolute_path(log_file)
    self._substitute_working_directory_into_command(command, abs_working_directory)
    if paired_with_pidfile:
        drone = self._get_drone_for_pidfile_id(paired_with_pidfile)
    else:
        drone = self._choose_drone_for_execution(num_processes, username, drone_hostnames_allowed)
    if (not drone):
        raise DroneManagerError(('command    failed;    no    drones    available:    %s' % command))
    logging.info(('command    =    %s' % command))
    logging.info(('log    file    =    %s:%s' % (drone.hostname, log_file)))
    self._write_attached_files(working_directory, drone)
    drone.queue_call('execute_command', command, abs_working_directory, log_file, pidfile_name)
    drone.active_processes += num_processes
    self._reorder_drone_queue()
    pidfile_path = os.path.join(abs_working_directory, pidfile_name)
    pidfile_id = PidfileId(pidfile_path)
    self.register_pidfile(pidfile_id)
    self._registered_pidfile_info[pidfile_id].num_processes = num_processes
    return pidfile_id
