def _process_kickstart_packages(self, data): """Process the kickstart packages.""" packages = PackagesConfigurationData() packages.core_group_enabled = not data.packages.nocore packages.default_environment_enabled = data.packages.default if data.packages.environment is not None: packages.environment = data.packages.environment packages.packages = data.packages.packageList packages.excluded_packages = data.packages.excludedList for group in data.packages.groupList: packages.groups.append(group.name) if group.include == GROUP_ALL: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_ALL if group.include == GROUP_REQUIRED: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_REQUIRED for group in data.packages.excludedGroupList: packages.excluded_groups.append(group.name) packages.docs_excluded = data.packages.excludeDocs packages.weakdeps_excluded = data.packages.excludeWeakdeps if data.packages.handleMissing == KS_MISSING_IGNORE: packages.missing_ignored = True if data.packages.handleBroken == KS_BROKEN_IGNORE: packages.broken_ignored = True if data.packages.instLangs == "": packages.languages = RPM_LANGUAGES_NONE elif data.packages.instLangs is not None: packages.languages = data.packages.instLangs if data.packages.multiLib: packages.multilib_policy = MULTILIB_POLICY_ALL if data.packages.timeout is not None: packages.timeout = data.packages.timeout if data.packages.retries is not None: packages.retries = data.packages.retries self.set_packages(packages) self.set_packages_kickstarted(data.packages.seen)
def get_installation_specs_environment_test(self): """Test the get_installation_specs function with environment.""" data = PackagesConfigurationData() data.environment = "environment-1" self.assertEqual(get_installation_specs(data), ( ["@environment-1", "@core"], [] )) env = "environment-2" self.assertEqual(get_installation_specs(data, default_environment=env), ( ["@environment-1", "@core"], [] )) data.default_environment_enabled = True self.assertEqual(get_installation_specs(data, default_environment=env), ( ["@environment-2", "@core"], [] ))