Пример #1
0
    def get_section_dependencies(self):
        dependencies = (self.manifest.get(self.section_name).get(
            self.item_name).get("depends_on", []))

        should_generate_shares = not (self.execution_mode
                                      == constants.EXECUTION_MODE_SPOKE
                                      or self.is_dry_run)

        these_dependencies = generate_dependency_tasks(
            dependencies,
            self.manifest_file_path,
            self.puppet_account_id,
            self.account_id,
            self.region,
            self.execution_mode,
        )

        if self.section_name in [
                constants.SPOKE_LOCAL_PORTFOLIOS, constants.LAUNCHES
        ]:
            if should_generate_shares:
                these_dependencies.append(
                    generate_shares_task.GenerateSharesTask(
                        puppet_account_id=self.puppet_account_id,
                        manifest_file_path=self.manifest_file_path,
                        section=self.section_name,
                    ))

        return these_dependencies
    def requires(self):
        requirements = dict()

        if self.account_id == self.puppet_account_id:
            requirements[
                "details"] = describe_product_as_admin_task.DescribeProductAsAdminTask(
                    manifest_file_path=self.manifest_file_path,
                    puppet_account_id=self.puppet_account_id,
                    portfolio=self.portfolio,
                    product=self.product,
                    account_id=self.account_id,
                    region=self.region,
                )
        else:
            requirements[
                "details"] = get_version_id_by_version_name_task.GetVersionIdByVersionName(
                    manifest_file_path=self.manifest_file_path,
                    puppet_account_id=self.puppet_account_id,
                    portfolio=self.portfolio,
                    product=self.product,
                    version=self.version,
                    account_id=self.account_id,
                    region=self.region,
                )
            if not (self.execution_mode == constants.EXECUTION_MODE_SPOKE
                    or self.is_dry_run):
                requirements[
                    "generate_shares"] = generate_shares_task.GenerateSharesTask(
                        puppet_account_id=self.puppet_account_id,
                        manifest_file_path=self.manifest_file_path,
                        section=constants.LAUNCHES,
                    )
        return requirements
 def requires(self):
     return dict(
         shares=generate_shares_task.GenerateSharesTask(
             puppet_account_id=self.puppet_account_id,
             manifest_file_path=self.manifest_file_path,
             section=constants.LAUNCHES,
         ),
         new_manifest=generate_manifest_with_ids_task.
         GenerateManifestWithIdsTask(
             puppet_account_id=self.puppet_account_id,
             manifest_file_path=self.manifest_file_path,
         ),
     )