Skip to content

Commit

Permalink
fixed the upload overwrite message (#2716)
Browse files Browse the repository at this point in the history
* fixed the upload message

* cr fixes

* changelog

* Update uploader.py

* Update CHANGELOG.md

* import constants

* isort

* black

---------

Co-authored-by: dorschw <81086590+dorschw@users.noreply.github.com>
  • Loading branch information
MosheEichler and dorschw committed Jan 29, 2023
1 parent 40eb27d commit 897d0c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Fixed an issue where git-*renamed_files* were not retrieved properly.
* Fixed an issue where test dependencies were calculated in all level dependencies calculation.
* Added a UUID to name mapper for **download** it replaces UUIDs with names on all downloaded files.
* Improved the message shown when using **upload** and overwriting packs.

## 1.9.0
* Fixed an issue where the Slack notifier was using a deprecated argument.
Expand Down
12 changes: 11 additions & 1 deletion demisto_sdk/commands/upload/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
CLASSIFIERS_DIR,
CONTENT_ENTITIES_DIRS,
DASHBOARDS_DIR,
ENV_DEMISTO_SDK_MARKETPLACE,
INCIDENT_FIELDS_DIR,
INCIDENT_TYPES_DIR,
INDICATOR_FIELDS_DIR,
Expand All @@ -28,6 +29,7 @@
TEST_PLAYBOOKS_DIR,
WIDGETS_DIR,
FileType,
MarketplaceVersions,
)
from demisto_sdk.commands.common.content.errors import ContentFactoryError
from demisto_sdk.commands.common.content.objects.abstract_objects import (
Expand Down Expand Up @@ -406,9 +408,17 @@ def notify_user_should_override_packs(self):
common_packs = installed_packs & set(self.pack_names) # type: ignore
if common_packs:
pack_names = "\n".join(common_packs)
marketplace = (
os.environ.get(
ENV_DEMISTO_SDK_MARKETPLACE, MarketplaceVersions.XSOAR
)
.lower()
.replace(MarketplaceVersions.MarketplaceV2, "XSIAM")
.upper()
)
click.secho(
f"This command will overwrite the following packs:\n{pack_names}.\n"
"Any changes made on XSOAR will be lost.",
f"Any changes made on {marketplace} will be lost.",
fg="bright_red",
)
if not self.override_existing:
Expand Down

0 comments on commit 897d0c2

Please sign in to comment.