Skip to content

Commit

Permalink
fix(#5219): Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-akim committed May 2, 2024
1 parent a9367dc commit a7cf339
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 5 additions & 5 deletions deployability/modules/testing/tests/helpers/central.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class WazuhCentralComponents:
@staticmethod
def install_aio(inventory_path, wazuh_version) -> None:
"""
Installs Wazuh Central Components AIO in the host
Installs Wazuh central components (AIO) in the host
Args:
inventory_path (str): host's inventory path
Expand All @@ -27,16 +27,16 @@ def install_aio(inventory_path, wazuh_version) -> None:
wazuh_version = '.'.join(wazuh_version.split('.')[:2])
os_name = HostInformation.get_os_name_from_inventory(inventory_path)

if 'debian' in os_name:
if 'curl' in Executor.execute_command(inventory_path, 'which curl'):
commands = [
f"wget https://packages.wazuh.com/{wazuh_version}/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check"
f"curl -sO https://packages.wazuh.com/{wazuh_version}/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check"
]

else:
commands = [
f"curl -sO https://packages.wazuh.com/{wazuh_version}/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check"
f"wget https://packages.wazuh.com/{wazuh_version}/wazuh-install.sh && sudo bash ./wazuh-install.sh -a --ignore-check"
]


logger.info(f'Installing Wazuh AIO in {HostInformation.get_os_name_and_version_from_inventory(inventory_path)}')
Executor.execute_commands(inventory_path, commands)

Expand Down
12 changes: 12 additions & 0 deletions deployability/modules/testing/tests/helpers/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ def get_client_keys(inventory_path) -> list[dict]:
clients.append(client_info)
return clients

@staticmethod
def has_curl(inventory_path) -> bool:
"""
Returns yes in case that curl is installed in Linux/macOS.
Args:
inventory_path (str): host's inventory path
Returns:
bool: True/False.
"""
return 'curl' in Executor.execute_command(inventory_path, 'which curl')

class HostConfiguration:

Expand Down

0 comments on commit a7cf339

Please sign in to comment.