Esempio n. 1
0
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp(override=filesystem.tftpd_dir())
        self.pipeline = Pipeline(parent=self,
                                 job=self.job,
                                 parameters=parameters)
        self.set_namespace_data(
            action=self.name,
            label="tftp",
            key="tftp_dir",
            value=self.tftp_dir,
            parameters=parameters,
        )

        for key in [
                "ramdisk", "kernel", "dtb", "nfsrootfs", "modules", "preseed"
        ]:
            if key in parameters:
                self.pipeline.add_action(
                    DownloaderAction(key,
                                     path=self.tftp_dir,
                                     params=parameters[key]))
                if key == "ramdisk":
                    self.set_namespace_data(
                        action=self.name,
                        label="tftp",
                        key="ramdisk",
                        value=True,
                        parameters=parameters,
                    )

        # TftpAction is a deployment, so once the files are in place, just do the overlay
        self.pipeline.add_action(PrepareOverlayTftp())
        self.pipeline.add_action(LxcCreateUdevRuleAction())
        if self.test_needs_deployment(parameters):
            self.pipeline.add_action(DeployDeviceEnvironment())
Esempio n. 2
0
    def populate(self, parameters):
        self.tftp_dir = self.mkdtemp(override=tftpd_dir())
        self.internal_pipeline = Pipeline(parent=self,
                                          job=self.job,
                                          parameters=parameters)
        self.set_namespace_data(action=self.name,
                                label='tftp',
                                key='tftp_dir',
                                value=self.tftp_dir,
                                parameters=parameters)

        for key in [
                'ramdisk', 'kernel', 'dtb', 'nfsrootfs', 'modules', 'preseed'
        ]:
            if key in parameters:
                self.internal_pipeline.add_action(
                    DownloaderAction(key, path=self.tftp_dir))
                if key == 'ramdisk':
                    self.set_namespace_data(action=self.name,
                                            label='tftp',
                                            key='ramdisk',
                                            value=True,
                                            parameters=parameters)

        # TftpAction is a deployment, so once the files are in place, just do the overlay
        self.internal_pipeline.add_action(PrepareOverlayTftp())
        self.internal_pipeline.add_action(LxcCreateUdevRuleAction())
        if self.test_needs_deployment(parameters):
            self.internal_pipeline.add_action(DeployDeviceEnvironment())