Sends a command to uBridge hypervisor.

        :param command: command to send
195136
def _ubridge_send(self, command):
        

        if not self._ubridge_hypervisor or not self._ubridge_hypervisor.is_running():
            yield from self._start_ubridge()
        if not self._ubridge_hypervisor or not self._ubridge_hypervisor.is_running():
            raise NodeError("Cannot send command '{}': uBridge is not running".format(command))
        try:
            yield from self._ubridge_hypervisor.send(command)
        except UbridgeError as e:
            raise UbridgeError("{}: {}".format(e, self._ubridge_hypervisor.read_stdout()))
364248
def sendline(self, cmd):
        '''
        
        '''
        self.conn.sendline(cmd, self.linesep)

        # saw_prompt = False
        ret_stdout = []
        ret_stderr = []
        while self.conn.has_unread_data:
            stdout, stderr = self.conn.recv()

            if stdout:
                ret_stdout.append(stdout)
            if stderr:
                log.debug('Error while executing command.')
                ret_stderr.append(stderr)

            if stdout and self.prompt_re.search(stdout):
                break

        return ''.join(ret_stdout), ''.join(ret_stderr)
1134127
def send_command_response(self,
                              source: list,
                              command: str,
                              *args,
                              **kwargs):
        
        args = _json.dumps(args).encode('utf8')
        kwargs = _json.dumps(kwargs).encode('utf8')
        if isinstance(source, list):
            frame = (*source, b'', command.encode('utf8'), args, kwargs)
        else:
            frame = (b'', command.encode('utf8'), args, kwargs)
        if self._run_control_loop:
            self.add_callback(self.command_socket.send_multipart, frame)
        else:
            self.command_socket.send_multipart(frame)
506363
def send(self, s, end=os.linesep, signal=False):
        """"""

        if self.blocking:
            raise RuntimeError('send can only be used on non-blocking commands.')

        if not signal:
            if self._uses_subprocess:
                return self.subprocess.communicate(s + end)
            else:
                return self.subprocess.send(s + end)
        else:
            self.subprocess.send_signal(s)
68785
def sendcommand(self, name, **kwargs):
        
        self.log("sending command %s(**%s)" % (name, kwargs))
        self.channel.send((name, kwargs))
228863
def send(self, command):
        ""
        if self.secure_rcon == self.RCON_NOSECURE:
            self.sock.send(rcon_nosecure_packet(self.password, command))
        elif self.secure_rcon == self.RCON_SECURE_TIME:
            self.sock.send(rcon_secure_time_packet(self.password, command))
        elif self.secure_rcon == self.RCON_SECURE_CHALLENGE:
            challenge = self.getchallenge()
            self.sock.send(rcon_secure_challenge_packet(self.password,
                                                        challenge, command))
        else:
            raise ValueError("Bad value of secure_rcon")
59305
def send_command(self, obj, command, *arguments):
        
        self._perform_command('{}/{}'.format(self.session_url, obj.ref), command, OperReturnType.no_output, *arguments)
376300
def send_command(self, command):
        """"""
        if self._pipe_commands:
            self._pipe_commands.send(command)
        else:
            if self.shutdown:
                # Stop delivering messages in shutdown.
                self.log.info(
                    "During shutdown no command queue pipe found for command\n%s",
                    str(command),
                )
            else:
                self.log.error(
                    "No command queue pipe found for command\n%s", str(command)
                )
769316
def send_command(command)
      Lacquer.configuration.varnish_servers.collect do |server|
        retries = 0
        response = nil
        begin
          retries += 1
          connection = Net::Telnet.new(
            'Host' => server[:host],
            'Port' => server[:port],
            'Timeout' => server[:timeout] || 5)

          if(server[:secret])
            connection.waitfor("Match" => /^107/) do |authentication_request|
              matchdata = /^107 \d{2}\s*(.{32}).*$/m.match(authentication_request) # Might be a bit ugly regex, but it works great!
              salt = matchdata[1]
              if(salt.empty?)
                raise VarnishError, "Bad authentication request"
              end

              digest = OpenSSL::Digest.new('sha256')
              digest << salt
              digest << "\n"
              digest << server[:secret]
              digest << salt
              digest << "\n"

              connection.cmd("String" => "auth #{digest.to_s}", "Match" => /\d{3}/) do |auth_response|
                if(!(/^200/ =~ auth_response))
                  raise AuthenticationError, "Could not authenticate"
                end
              end
            end
          end

          connection.cmd('String' => command, 'Match' => /\n\n/) {|r| response = r.split("\n").first.strip}
          connection.close if connection.respond_to?(:close)
        rescue Exception => e
          if retries < Lacquer.configuration.retries
            retry
          else
            if Lacquer.configuration.command_error_handler
              Lacquer.configuration.command_error_handler.call({
               :error_class   => "Varnish Error, retried #{Lacquer.configuration.retries} times",
               :error_message => "Error while trying to connect to #{server[:host]}:#{server[:port]}: #{e}",
               :parameters    => server,
               :response      => response })
            elsif e.kind_of?(Lacquer::AuthenticationError)
              raise e
            else
              raise VarnishError.new("Error while trying to connect to #{server[:host]}:#{server[:port]} #{e}")
            end
          end
        end
        response
      end
    end
772897
def send(self, cmd):
        
        self._bridge.send(cmd, wait=self.wait, reps=self.reps)
1070107
def send(self, command, sender, target, args, kwargs):
        
        command = get_command(command)
        data = {'command': command.__name__,
                'id': create_aid(),
                'sender': actor_identity(sender),
                'target': actor_identity(target),
                'args': args if args is not None else (),
                'kwargs': kwargs if kwargs is not None else {}}

        waiter = self._loop.create_future()
        ack = None
        if command.ack:
            ack = create_aid()
            data['ack'] = ack
            self.pending_responses[ack] = waiter

        try:
            self.write(data)
        except Exception as exc:
            waiter.set_exception(exc)
            if ack:
                self.pending_responses.pop(ack, None)
        else:
            if not ack:
                waiter.set_result(None)
        return waiter
340632
def _send_command_list(self, commands):
        """"""
        output = ""
        for command in commands:
            output += self.device.send_command(
                command, strip_prompt=False, strip_command=False
            )
        return output
1156596
def send_command(cmd, content, options)
      begin
        options ||= {}
        cmd = { :name => cmd, :content => RightScale::AuditProxy.force_utf8(content), :options => options }
        EM.next_tick { @agent_connection.send_command(cmd) }
      rescue Exception => e
        $stderr.puts 'Failed to audit'
        $stderr.puts Log.format("Failed to audit '#{cmd[:name]}'", e, :trace)
      end
    end
12154
def send_command_return(self, obj, command, *arguments):
        
        index_command = obj._build_index_command(command, *arguments)
        return obj._extract_return(command, self.chassis_list[obj.chassis].sendQuery(index_command))
1127093
def _cmd(self, command, uid=None):
        
        if not uid:
            uid = self.uid
        self._client_send(json.dumps({'cmd': command, 'uid': uid}))
        return self._client_receive()
1345085
def send_frame(self, cmd, headers=None, body=''):
        
        frame = utils.Frame(cmd, headers, body)
        self.transport.transmit(frame)
1254703
def send_command(self, command, arg=None):
    
    if arg is not None:
      command = '%s:%s' % (command, arg)
    self._write(six.StringIO(command), len(command))