From 567db217e7653de160364dda2c993e8530646e5d Mon Sep 17 00:00:00 2001 From: Jakub Rak Date: Fri, 13 Dec 2024 09:41:54 +0100 Subject: [PATCH] Fix shellcheck issues --- .../tests/command/windows/windows_command_wrapper.py | 2 +- .../tests/resources/installers/Dynatrace-OneAgent-Linux.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/oneagent/tests/command/windows/windows_command_wrapper.py b/roles/oneagent/tests/command/windows/windows_command_wrapper.py index 7fad19b..1eac646 100644 --- a/roles/oneagent/tests/command/windows/windows_command_wrapper.py +++ b/roles/oneagent/tests/command/windows/windows_command_wrapper.py @@ -13,7 +13,7 @@ def get_file_content(self, address: str, file: Path) -> CommandResult: return self.executor.execute(address, "type", str(file)) def file_exists(self, address: str, file: Path) -> CommandResult: - # Windows needs double quoting for passing paths containing + # Windows needs double quoting for passing paths # containing spaces, single quotes don't work return self.executor.execute( address, f'if exist "{file}" (exit 0) else (exit 1)') diff --git a/roles/oneagent/tests/resources/installers/Dynatrace-OneAgent-Linux.sh b/roles/oneagent/tests/resources/installers/Dynatrace-OneAgent-Linux.sh index 796e4a6..5cf0d74 100644 --- a/roles/oneagent/tests/resources/installers/Dynatrace-OneAgent-Linux.sh +++ b/roles/oneagent/tests/resources/installers/Dynatrace-OneAgent-Linux.sh @@ -25,6 +25,7 @@ INSTALL_DIR="${DEFAULT_INSTALL_DIR}" parseParams() { while [ $# -gt 0 ]; do + # shellcheck disable=SC2039 local param="${1}" if [ "${param}" = "--version" ]; then printf "%s\n" "${INSTALLER_VERSION}" @@ -39,6 +40,7 @@ parseParams() { } uninstall() { + # shellcheck disable=SC2039 local uninstallScript="${INSTALL_DIR}/agent/${UNINSTALL_SCRIPT}" if [ -f "${uninstallScript}" ]; then "${uninstallScript}" @@ -46,6 +48,7 @@ uninstall() { } deployOneagentCtl() { + # shellcheck disable=SC2039 local ONEAGENTCTL_DIR="${INSTALL_DIR}/agent/tools" mkdir -p "${ONEAGENTCTL_DIR}" mkdir -p "${DEPLOYMENT_CONF_PATH}" @@ -54,6 +57,7 @@ deployOneagentCtl() { } deployUninstallScript() { + # shellcheck disable=SC2039 local UNINSTALL_DIR="${INSTALL_DIR}/agent" mkdir -p "${UNINSTALL_DIR}" printf '%s' "${UNINSTALL_CODE}" > "${UNINSTALL_DIR}/${UNINSTALL_SCRIPT}" @@ -61,7 +65,7 @@ deployUninstallScript() { } applyConfig() { - "${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" ${CTL_PARAMS} + "${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" "${CTL_PARAMS}" } main() {