original_docstring:  Perform a command against an SSH accessible server.
          
docstring: Perform a command against an SSH accessible server.
docstring_tokens: Perform a command against an SSH accessible server .
code: def ssh_exec_cmd(self, *args):
          """ Perform a command against an SSH accessible server.
          """
          def getDirName():
              dirName = '.'
              if (len(args) > 1):
                  dirName = args[1]
              return dirName
          def getMode():
              mode = 511
              if (len(args) > 2):
                  mode = args[2]
              return mode
          def getDirName2():
              dirName = '.'
              if (len(args) > 2):
                  dirName = args[2]
              return dirName
          def getSize():
              size = 0
              if (len(args) > 2):
                  size = args[2]
              return size
          def getTimes():
              times = ()
              if (len(args) > 3):
                  times = (args[2],args[2])
              return times
          if (self.sftp == None):
              self.sftp = self.ssh_connect_client(self.transport)
          value = None
          try:
              if (args[0].find(self.const_getcwd_symbol) > -1):
                  self.sftp.chdir(getDirName())
                  value = self.sftp.getcwd()
              elif (args[0].find(self.const_listdir_symbol) > -1):
                  value = self.sftp.listdir(getDirName())
              elif (args[0].find(self.const_listdir_attr_symbol) > -1):
                  value = self.sftp.listdir_attr(getDirName())
              elif (args[0].find(self.const_lstat_symbol) > -1) or (args[0].find(self.const_stat_symbol) > -1):
                  value = self.sftp.lstat(getDirName())
              elif (args[0].find(self.const_mkdir_symbol) > -1):
                  value = self.sftp.mkdir(getDirName(),getMode())
              elif (args[0].find(self.const_normalize_symbol) > -1):
                  value = self.sftp.normalize(getDirName())
              elif (args[0].find(self.const_readlink_symbol) > -1):
                  value = self.sftp.readlink(getDirName())
              elif (args[0].find(self.const_remove_symbol) > -1):
                  value = self.sftp.remove(getDirName())
              elif (args[0].find(self.const_rename_symbol) > -1):
                  value = self.sftp.rename(getDirName(),getDirName2())
              elif (args[0].find(self.const_rmdir_symbol) > -1):
                  value = self.sftp.rmdir(getDirName())
              elif (args[0].find(self.const_stat_symbol) > -1):
                  value = self.sftp.stat(getDirName())
              elif (args[0].find(self.const_symlink_symbol) > -1):
                  value = self.sftp.symlink(getDirName(),getDirName2())
              elif (args[0].find(self.const_truncate_symbol) > -1):
                  value = self.sftp.truncate(getDirName(),getSize())
              elif (args[0].find(self.const_unlink_symbol) > -1):
                  value = self.sftp.unlink(getDirName())
              elif (args[0].find(self.const_utime_symbol) > -1):
                  value = self.sftp.utime(getDirName(),getTimes())
          except:
              return None
          return value
code_tokens: def ssh_exec_cmd ( self , * args ) : def getDirName ( ) : dirName = '.' if ( len ( args ) > 1 ) : dirName = args [ 1 ] return dirName def getMode ( ) : mode = 511 if ( len ( args ) > 2 ) : mode = args [ 2 ] return mode def getDirName2 ( ) : dirName = '.' if ( len ( args ) > 2 ) : dirName = args [ 2 ] return dirName def getSize ( ) : size = 0 if ( len ( args ) > 2 ) : size = args [ 2 ] return size def getTimes ( ) : times = ( ) if ( len ( args ) > 3 ) : times = ( args [ 2 ] , args [ 2 ] ) return times if ( self . sftp == None ) : self . sftp = self . ssh_connect_client ( self . transport ) value = None try : if ( args [ 0 ] . find ( self . const_getcwd_symbol ) > - 1 ) : self . sftp . chdir ( getDirName ( ) ) value = self . sftp . getcwd ( ) elif ( args [ 0 ] . find ( self . const_listdir_symbol ) > - 1 ) : value = self . sftp . listdir ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_listdir_attr_symbol ) > - 1 ) : value = self . sftp . listdir_attr ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_lstat_symbol ) > - 1 ) or ( args [ 0 ] . find ( self . const_stat_symbol ) > - 1 ) : value = self . sftp . lstat ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_mkdir_symbol ) > - 1 ) : value = self . sftp . mkdir ( getDirName ( ) , getMode ( ) ) elif ( args [ 0 ] . find ( self . const_normalize_symbol ) > - 1 ) : value = self . sftp . normalize ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_readlink_symbol ) > - 1 ) : value = self . sftp . readlink ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_remove_symbol ) > - 1 ) : value = self . sftp . remove ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_rename_symbol ) > - 1 ) : value = self . sftp . rename ( getDirName ( ) , getDirName2 ( ) ) elif ( args [ 0 ] . find ( self . const_rmdir_symbol ) > - 1 ) : value = self . sftp . rmdir ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_stat_symbol ) > - 1 ) : value = self . sftp . stat ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_symlink_symbol ) > - 1 ) : value = self . sftp . symlink ( getDirName ( ) , getDirName2 ( ) ) elif ( args [ 0 ] . find ( self . const_truncate_symbol ) > - 1 ) : value = self . sftp . truncate ( getDirName ( ) , getSize ( ) ) elif ( args [ 0 ] . find ( self . const_unlink_symbol ) > - 1 ) : value = self . sftp . unlink ( getDirName ( ) ) elif ( args [ 0 ] . find ( self . const_utime_symbol ) > - 1 ) : value = self . sftp . utime ( getDirName ( ) , getTimes ( ) ) except : return None return value
short_docstring: Perform a command against an SSH accessible server.
short_docstring_tokens: Perform a command against an SSH accessible server .
comment: """ Perform a command against an SSH accessible server.
          """