Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed to upload pack as custom from version 8.9.0 #4636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions demisto_sdk/commands/content_graph/objects/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

MINIMAL_UPLOAD_SUPPORTED_VERSION = Version("6.5.0")
MINIMAL_ALLOWED_SKIP_VALIDATION_VERSION = Version("6.6.0")

MINIMAL_SUPPORTED_CUSTOM_UPLOAD_VERSION = Version("8.9.0")

def upload_zip(
path: Path,
Expand All @@ -98,18 +98,23 @@ def upload_zip(
f"Uploading packs to XSOAR versions earlier than {MINIMAL_UPLOAD_SUPPORTED_VERSION} is no longer supported."
"Use older versions of the Demisto-SDK for that (<=1.13.0)"
)
server_kwargs = {"skip_verify": "true"}
if target_demisto_version >= MINIMAL_SUPPORTED_CUSTOM_UPLOAD_VERSION:
response = client.upload_custom_packs(
file=str(path)
)
else:
server_kwargs = {"skip_verify": "true"}

if (
skip_validations
and target_demisto_version >= MINIMAL_ALLOWED_SKIP_VALIDATION_VERSION
):
server_kwargs["skip_validation"] = "true"
if (
skip_validations
and target_demisto_version >= MINIMAL_ALLOWED_SKIP_VALIDATION_VERSION
):
server_kwargs["skip_validation"] = "true"

response = client.upload_content_packs(
file=str(path),
**server_kwargs,
)
response = client.upload_content_packs(
file=str(path),
**server_kwargs,
)
if response is None: # uploaded successfully
return True

Expand Down
Loading