Skip to content

Commit

Permalink
dont clean packs from xsoar_saas (demisto#30347)
Browse files Browse the repository at this point in the history
* dont clean packs from xsoar_saas

* remove repeated code

* create_dependencies as well

* Removed from the dependency
  • Loading branch information
omerKarkKatz authored Oct 24, 2023
1 parent 5215b52 commit decc524
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Tests/Marketplace/upload_packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit decc524

Please sign in to comment.