Skip to content

Commit

Permalink
Merge b68e74d into 5feef1e
Browse files Browse the repository at this point in the history
  • Loading branch information
anas-yousef committed Feb 18, 2024
2 parents 5feef1e + b68e74d commit 620e898
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .changelog/4048.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Fixed an issue where **validate** would not mention the reason when failing to connect to MDX.
type: fix
pr_number: 4048
4 changes: 4 additions & 0 deletions demisto_sdk/commands/common/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,10 @@
"code": "RM114",
"related_field": "",
},
"cannot_connect_to_mdx_server": {
"code": "RM115",
"related_field": "",
},
# RN - Release Notes
"missing_release_notes": {
"code": "RN100",
Expand Down
9 changes: 7 additions & 2 deletions demisto_sdk/commands/common/hook_validations/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ def is_valid_file(self) -> bool:
def mdx_verify_server(self) -> bool:
server_started = mdx_server_is_up()
if not server_started:
return False
raise Exception(
"Cannot validate MDX file since node server is not responsive. You can skip this validation by using the validation code RM115"
)
for _ in range(RETRIES_VERIFY_MDX):
try:
readme_content = self.fix_mdx()
Expand All @@ -245,6 +247,7 @@ def mdx_verify_server(self) -> bool:
start_local_MDX_server()
return True

@error_codes("RM115")
def is_mdx_file(self) -> bool:
html = self.is_html_doc()
valid = self.should_run_mdx_validation()
Expand Down Expand Up @@ -406,7 +409,9 @@ def is_docker_available():
bool: True if the daemon is accessible
"""
try:
docker_client: docker.DockerClient = init_global_docker_client(log_prompt="DockerPing") # type: ignore
docker_client: docker.DockerClient = init_global_docker_client(
log_prompt="DockerPing"
) # type: ignore
docker_client.ping()
return True
except Exception:
Expand Down
8 changes: 7 additions & 1 deletion demisto_sdk/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
YAMLContentUnifiedObject,
)
from demisto_sdk.commands.common.content.objects.pack_objects.pack import Pack
from demisto_sdk.commands.common.logger import logger

ContentEntity = Union[YAMLContentUnifiedObject, YAMLContentObject, JSONContentObject]

Expand All @@ -38,7 +39,12 @@ def check_configuration_file(command, args):
try:
config = ConfigParser(allow_no_value=True)
config.read(config_file_path)

config_sections = {
section: dict(config[section]) for section in config.sections()
}
logger.info(
f"[yellow].demisto-sdk-conf sections={config_sections}[/yellow]"
)
if command in config.sections():
for key in config[command]:
if key in args:
Expand Down

0 comments on commit 620e898

Please sign in to comment.