Exemple #1
0
    def run(self, connection, max_end_time):
        connection = super().run(connection, max_end_time)
        mount_point = self.get_namespace_data(action="mount-vexpress-usbmsd",
                                              label="vexpress-fw",
                                              key="mount-point")
        if not os.path.exists(mount_point):
            raise InfrastructureError("Unable to locate mount point: %s" %
                                      mount_point)

        src_dir = self.get_namespace_data(
            action="extract-vexpress-recovery-image",
            label="file",
            key="recovery_image")
        if not os.path.exists(src_dir):
            raise InfrastructureError(
                "Unable to locate recovery image source directory: %s" %
                src_dir)

        self.logger.debug(
            "Removing existing recovery image from Versatile Express mass storage device.."
        )
        try:
            remove_directory_contents(mount_point)
        except Exception:
            raise JobError("Failed to erase old recovery image")

        self.logger.debug(
            "Transferring new recovery image to Versatile Express mass storage device.."
        )
        try:
            copy_directory_contents(src_dir, mount_point)
        except Exception:
            raise JobError("Failed to deploy recovery image to %s" %
                           mount_point)
        return connection
Exemple #2
0
    def run(self, connection, max_end_time, args=None):
        connection = super(DeployVExpressRecoveryImage, self).run(connection, max_end_time, args)
        mount_point = self.get_namespace_data(action='mount-vexpress-usbmsd', label='vexpress-fw', key='mount-point')
        try:
            os.path.realpath(mount_point)
        except OSError:
            raise InfrastructureError("Unable to locate mount point: %s" % mount_point)

        src_dir = self.get_namespace_data(action='extract-vexpress-recovery-image', label='file', key='recovery_image')
        try:
            os.path.realpath(src_dir)
        except OSError:
            raise InfrastructureError("Unable to locate recovery image source directory: %s" % src_dir)

        self.logger.debug("Removing existing recovery image from Versatile Express mass storage device..")
        try:
            remove_directory_contents(mount_point)
        except Exception:
            raise JobError("Failed to erase old recovery image")

        self.logger.debug("Transferring new recovery image to Versatile Express mass storage device..")
        try:
            copy_directory_contents(src_dir, mount_point)
        except Exception:
            raise JobError("Failed to deploy recovery image to %s" % mount_point)
        return connection
Exemple #3
0
    def run(self, connection, max_end_time, args=None):
        connection = super(DeployVExpressRecoveryImage,
                           self).run(connection, max_end_time, args)
        mount_point = self.get_namespace_data(action='mount-vexpress-usbmsd',
                                              label='vexpress-fw',
                                              key='mount-point')
        try:
            os.path.realpath(mount_point)
        except OSError:
            raise InfrastructureError("Unable to locate mount point: %s" %
                                      mount_point)

        src_dir = self.get_namespace_data(
            action='extract-vexpress-recovery-image',
            label='file',
            key='recovery_image')
        try:
            os.path.realpath(src_dir)
        except OSError:
            raise InfrastructureError(
                "Unable to locate recovery image source directory: %s" %
                src_dir)

        self.logger.debug(
            "Removing existing recovery image from Versatile Express mass storage device.."
        )
        try:
            remove_directory_contents(mount_point)
        except Exception:
            raise JobError("Failed to erase old recovery image")

        self.logger.debug(
            "Transferring new recovery image to Versatile Express mass storage device.."
        )
        try:
            copy_directory_contents(src_dir, mount_point)
        except Exception:
            raise JobError("Failed to deploy recovery image to %s" %
                           mount_point)
        return connection