Skip to content

Commit

Permalink
Merge 52225fd into 43be044
Browse files Browse the repository at this point in the history
  • Loading branch information
anas-yousef authored Feb 21, 2024
2 parents 43be044 + 52225fd commit 1581956
Show file tree
Hide file tree
Showing 4 changed files with 28 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
17 changes: 15 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,17 @@ def is_valid_file(self) -> bool:
def mdx_verify_server(self) -> bool:
server_started = mdx_server_is_up()
if not server_started:
return False
if self.handle_error(
"Validation of MDX file failed due to unable to start the mdx server. You can skip this by adding RM103"
" to the list of skipped validations under '.pack-ignore'.",
error_code="RM103",
file_path=self.file_path,
):
return False
logger.info(
"[yellow]Validation of MDX file failed due to unable to start the mdx server, skipping.[/yellow]"
)
return True
for _ in range(RETRIES_VERIFY_MDX):
try:
readme_content = self.fix_mdx()
Expand All @@ -245,6 +255,7 @@ def mdx_verify_server(self) -> bool:
start_local_MDX_server()
return True

@error_codes("RM103")
def is_mdx_file(self) -> bool:
html = self.is_html_doc()
valid = self.should_run_mdx_validation()
Expand Down Expand Up @@ -406,7 +417,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
2 changes: 2 additions & 0 deletions demisto_sdk/commands/validate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ If you wish to ignore errors for a specific file in the pack insert the followin
[file:FILE_NAME]
ignore=BA101
```

For more information, please see the following [document](https://xsoar.pan.dev/docs/reference/packs/content-management#development).
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 1581956

Please sign in to comment.