Beispiel #1
0
 def set_contents(self, filename, data):
     self.mtx.acquire()
     try:
         ret = WbAdminSSH.set_contents(self, filename, data)
     finally:
         self.mtx.release()
     return ret
Beispiel #2
0
    def exec_cmd(self,
                 cmd,
                 as_admin=0,
                 admin_password=None,
                 output_handler=None,
                 read_size=128,
                 get_channel_cb=None):
        output = None
        retcode = None

        self.mtx.acquire()
        dprint_ex(3, "cmd = ", cmd, ", sudo = ", as_admin)
        try:
            (output,
             retcode) = WbAdminSSH.exec_cmd(self,
                                            cmd,
                                            as_admin=as_admin,
                                            admin_password=admin_password,
                                            output_handler=output_handler,
                                            read_size=read_size,
                                            get_channel_cb=get_channel_cb)
            dprint_ex(3, "Done cmd = ", cmd)
        finally:
            self.mtx.release()

        return (output, retcode)
Beispiel #3
0
 def get_contents(self, filename):
     self.mtx.acquire()
     try:
         ret = WbAdminSSH.get_contents(self, filename)
     finally:
         self.mtx.release()
     return ret
Beispiel #4
0
 def set_contents(self, filename, data):
   self.mtx.acquire()
   try:
     ret = WbAdminSSH.set_contents(self, filename, data)
   finally:
     self.mtx.release()
   return ret
Beispiel #5
0
 def get_contents(self, filename):
   self.mtx.acquire()
   try:
     ret = WbAdminSSH.get_contents(self, filename)
   finally:
     self.mtx.release()
   return ret
Beispiel #6
0
  def exec_cmd(self, cmd, as_admin = 0, admin_password = None, output_handler = None, read_size = 128, get_channel_cb = None):
    output   = None
    retcode  = None

    self.mtx.acquire()
    dprint_ex(3, "cmd = ", cmd, ", sudo = ", as_admin)
    try:
      (output, retcode) = WbAdminSSH.exec_cmd(self, cmd, 
                                      as_admin=as_admin, 
                                      admin_password=admin_password, 
                                      output_handler=output_handler,
                                      read_size = read_size,
                                      get_channel_cb = get_channel_cb)
      dprint_ex(3, "Done cmd = ", cmd)
    finally:
      self.mtx.release()
    
    return (output, retcode)
  def exec_cmd(self, cmd, as_admin = 0, admin_password = None, output_handler = None, read_size = 128, get_channel_cb = None):
    output   = None
    retcode  = None

    self.mtx.acquire()
    log_debug3(_this_file, '%s:exec_cmd(cmd="%s", sudo=%s)\n' % (self.__class__.__name__, cmd, str(as_admin)) )
    try:
      (output, retcode) = WbAdminSSH.exec_cmd(self, cmd, 
                                      as_admin=as_admin, 
                                      admin_password=admin_password, 
                                      output_handler=output_handler,
                                      read_size = read_size,
                                      get_channel_cb = get_channel_cb)
      log_debug3(_this_file, '%s:exec_cmd(): Done cmd="%s"\n' % (self.__class__.__name__, cmd) )
    finally:
      self.mtx.release()
    
    return (output, retcode)