Exemplo n.º 1
0
 def _probe(self):
     
     
     if not self.support_vectors.get('exists').execute({ 'rpath' : self.args['remote_mount'] }):
         raise ProbeException(self.name, '%s \'%s\'' % (WARN_HTTPFS_MOUNTPOINT, self.args['remote_mount']))             
     
     self.args['remote_mount'] = self.support_vectors.get('normalize').execute({ 'path' : self.args['remote_mount'] })
 
     
     if self.args['umount_all']:
         # Umount all httpfs partitions
         self.__umount_all()
         raise ProbeSucceed(self.name, 'Unmounted partitions')
     
     if not self.args['just_mount']:
         # Upload remote
         try:    
             Upload2web._probe(self)
         except ProbeSucceed:
             pass
             
     if not self.args['just_install']:
         
         if not self.args['local_mount']:
             self.args['local_mount'] = mkdtemp()
             
         cmd = '%s mount %s %s %s' % (self.args['httpfs_path'], self.args['url'], self.args['local_mount'], self.args['remote_mount'])
 
         status, output = getstatusoutput(cmd)
         if status == 0:
             if output:
                 raise ProbeException(self.name,'%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s' % (WARN_HTTPFS_OUTP, cmd, output.replace('\n', '\n> '), WARN_HTTPFS_CHECK))
                 
         else:
             raise ProbeException(self.name,'%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s' % (WARN_HTTPFS_RUN, cmd, output.replace('\n', '\n> '), WARN_HTTPFS_CHECK))
Exemplo n.º 2
0
 def _probe(self):
     
     
     if not self.support_vectors.get('exists').execute({ 'rpath' : self.args['remote_mount'] }):
         raise ProbeException(self.name, '%s \'%s\'' % (WARN_HTTPFS_MOUNTPOINT, self.args['remote_mount']))             
     
     self.args['remote_mount'] = self.support_vectors.get('normalize').execute({ 'path' : self.args['remote_mount'] })
 
     
     if self.args['umount_all']:
         # Umount all httpfs partitions
         self.__umount_all()
         raise ProbeSucceed(self.name, 'Unmounted partitions')
     
     if not self.args['just_mount']:
         # Upload remote
         try:    
             Upload2web._probe(self)
         except ProbeSucceed:
             pass
             
     if not self.args['just_install']:
         
         if not self.args['local_mount']:
             self.args['local_mount'] = mkdtemp()
             
         cmd = '%s mount %s %s %s' % (self.args['httpfs_path'], self.args['url'], self.args['local_mount'], self.args['remote_mount'])
 
         status, output = getstatusoutput(cmd)
         if status == 0:
             if output:
                 raise ProbeException(self.name,'%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s' % (WARN_HTTPFS_OUTP, cmd, output.replace('\n', '\n> '), WARN_HTTPFS_CHECK))
                 
         else:
             raise ProbeException(self.name,'%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s' % (WARN_HTTPFS_RUN, cmd, output.replace('\n', '\n> '), WARN_HTTPFS_CHECK))
Exemplo n.º 3
0
    def _probe(self):

        if not self.support_vectors.get("exists").execute({"rpath": self.args["remote_mount"]}):
            raise ProbeException(self.name, "%s '%s'" % (WARN_HTTPFS_MOUNTPOINT, self.args["remote_mount"]))

        self.args["remote_mount"] = self.support_vectors.get("normalize").execute({"path": self.args["remote_mount"]})

        if self.args["umount_all"]:
            # Umount all httpfs partitions
            self.__umount_all()
            raise ProbeSucceed(self.name, "Unmounted partitions")

        if not self.args["just_mount"]:
            # Upload remote
            try:
                Upload2web._probe(self)
            except ProbeSucceed:
                pass

        if not self.args["just_install"]:

            if not self.args["local_mount"]:
                self.args["local_mount"] = mkdtemp()

            cmd = "%s mount %s %s %s" % (
                self.args["httpfs_path"],
                self.args["url"],
                self.args["local_mount"],
                self.args["remote_mount"],
            )

            status, output = getstatusoutput(cmd)
            if status == 0:
                if output:
                    raise ProbeException(
                        self.name,
                        "%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s"
                        % (WARN_HTTPFS_OUTP, cmd, output.replace("\n", "\n> "), WARN_HTTPFS_CHECK),
                    )

            else:
                raise ProbeException(
                    self.name,
                    "%s\nCOMMAND:\n$ %s\nOUTPUT:\n> %s\n%s"
                    % (WARN_HTTPFS_RUN, cmd, output.replace("\n", "\n> "), WARN_HTTPFS_CHECK),
                )