def _generate_import_job(self,
                             upload_id,
                             openFile,
                             fileFormat,
                             stylesheet=None,
                             commit_job=False):

        _debug("S3Importer._generate_import_job(%s, %s, %s, %s)",
               upload_id,
               openFile,
               fileFormat,
               stylesheet,
               )

        # ---------------------------------------------------------------------
        # CSV
        if fileFormat in ("csv", "comma-separated-values"):

            fmt = "csv"
            src = openFile

        # ---------------------------------------------------------------------
        # XLS
        elif fileFormat in ("xls", "xlsx", "xlsm"):

            fmt = "xls"
            src = openFile

        # ---------------------------------------------------------------------
        # XML
        # @todo: implement
        #elif fileFormat == "xml":

        # ---------------------------------------------------------------------
        # S3JSON
        # @todo: implement
        #elif fileFormat == "s3json":

        # ---------------------------------------------------------------------
        # PDF
        # @todo: implement
        #elif fileFormat == "pdf":

        # ---------------------------------------------------------------------
        # Unsupported Format
        else:
            msg = self.messages.unsupported_file_type % fileFormat
            self.error = msg
            _debug(msg)
            return None

        # Get the stylesheet
        if stylesheet == None:
            stylesheet = self._get_stylesheet()
        if stylesheet == None:
            return None

        request = self.request
        resource = request.resource

        # Before calling import tree ensure the db.table is the controller_table
        self.table = self.controller_table
        self.tablename = self.controller_tablename

        # Pass stylesheet arguments
        args = Storage()
        mode = request.get_vars.get("xsltmode", None)
        if mode is not None:
            args.update(mode=mode)

        # Generate the import job
        resource.import_xml(src,
                            format=fmt,
                            extra_data=self.csv_extra_data,
                            stylesheet=stylesheet,
                            ignore_errors = True,
                            commit_job = commit_job,
                            **args)

        job = resource.job
        if job is None:
            if resource.error:
                # Error
                self.error = resource.error
                return None
            else:
                # Nothing to import
                self.warning = self.messages.no_records_to_import
                return None
        else:
            # Job created
            db = current.db
            job_id = job.job_id
            errors = current.xml.collect_errors(job)
            if errors:
                current.response.s3.error_report = errors
            query = (self.upload_table.id == upload_id)
            result = db(query).update(job_id=job_id)
            # @todo: add check that result == 1, if not we are in error
            # Now commit the changes
            db.commit()

        self.job_id = job_id
        return True

    # -------------------------------------------------------------------------
``attach_volume`` does not attempt to use device paths that are already
dataset/ETHPy150Open sahana/eden/modules/s3/s3import.py/S3Importer._generate_import_job--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/agents/functional/test_ebs.py/EBSBlockDeviceAPIInterfaceTests.test_attach_when_foreign_device_has_next_device