From decc524576937a29c4d41ab1d56b9a1a5ea18b32 Mon Sep 17 00:00:00 2001 From: omerKarkKatz <95565843+omerKarkKatz@users.noreply.github.com> Date: Tue, 24 Oct 2023 19:24:03 +0300 Subject: [PATCH] dont clean packs from xsoar_saas (#30347) * dont clean packs from xsoar_saas * remove repeated code * create_dependencies as well * Removed from the dependency --- Tests/Marketplace/upload_packs.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Tests/Marketplace/upload_packs.py b/Tests/Marketplace/upload_packs.py index cb64665616ec..efa320ab5c83 100644 --- a/Tests/Marketplace/upload_packs.py +++ b/Tests/Marketplace/upload_packs.py @@ -20,7 +20,7 @@ json_write from Tests.Marketplace.marketplace_statistics import StatisticsHandler from Tests.Marketplace.marketplace_constants import XSIAM_MP, PackStatus, Metadata, GCPConfig, BucketUploadFlow, \ - CONTENT_ROOT_PATH, PACKS_FOLDER, IGNORED_FILES, LANDING_PAGE_SECTIONS_PATH, SKIPPED_STATUS_CODES + CONTENT_ROOT_PATH, PACKS_FOLDER, IGNORED_FILES, LANDING_PAGE_SECTIONS_PATH, SKIPPED_STATUS_CODES, XSOAR_MP, XSOAR_SAAS_MP from demisto_sdk.commands.common.tools import str2bool, open_id_set_file from demisto_sdk.commands.content_graph.interface.neo4j.neo4j_graph import Neo4jContentGraphInterface from Tests.scripts.utils.log_util import install_logging @@ -209,17 +209,12 @@ def clean_non_existing_packs(index_folder_path: str, private_packs: list, storag logging.info("Start cleaning non existing packs in index.") valid_pack_names = {p.name for p in content_packs} - if marketplace == 'xsoar': + if marketplace in [XSOAR_MP, XSOAR_SAAS_MP]: private_packs_names = {p.get('id', '') for p in private_packs} valid_pack_names.update(private_packs_names) - # search for invalid packs folder inside index - invalid_packs_names = {(entry.name, entry.path) for entry in os.scandir(index_folder_path) if - entry.name not in valid_pack_names and entry.is_dir()} - else: - # search for invalid packs folder inside index - invalid_packs_names = {(entry.name, entry.path) for entry in os.scandir(index_folder_path) if - entry.name not in valid_pack_names and entry.is_dir()} - + # search for invalid packs folder inside index + invalid_packs_names = {(entry.name, entry.path) for entry in os.scandir(index_folder_path) if + entry.name not in valid_pack_names and entry.is_dir()} if invalid_packs_names: try: logging.warning(f"Found the following invalid packs: {invalid_packs_names}") @@ -1461,7 +1456,7 @@ def main(): ) # dependencies zip is currently supported only for marketplace=xsoar, not for xsiam/xpanse - if is_create_dependencies_zip and marketplace == 'xsoar': + if is_create_dependencies_zip and marketplace == XSOAR_MP: # handle packs with dependencies zip upload_packs_with_dependencies_zip(storage_bucket, storage_base_path, signature_key, packs_for_current_marketplace_dict)