Skip to content

Commit

Permalink
Updated tests, and debugging, min Python version 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Dec 12, 2024
1 parent 0075aa9 commit 316e65a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
name: Rewrite Code to be Py3.9+
args: [--py39-plus]
name: Rewrite Code to be Py3.6+
args: [--py36-plus]
## DGM name: Rewrite Code to be Py3.9+
## DGM args: [--py39-plus]

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
Expand Down
8 changes: 7 additions & 1 deletion bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#======================================================================================================================
set -o nounset # Treat unset variables as an error

__ScriptVersion="2024.12.09"
__ScriptVersion="2024.12.12"
__ScriptName="bootstrap-salt.sh"

__ScriptFullName="$0"
Expand Down Expand Up @@ -2468,6 +2468,12 @@ __check_services_systemd() {
servicename=$1
echodebug "Checking if service ${servicename} is enabled"

## DGM
if [ "${DISTRO_NAME_L}" = "amazon_linux_ami" ] && [ "${DISTRO_VERSION}" = "2" ]; then
echoinfo "DGM skipping the is-enabled test on AMZN2, since command 'systemctl is-enabled salt-minion' is generating error msg 'Failed to get D-Bus connection: No such file or directory' on AMZN2 container"
return 0
fi

if [ "$(systemctl is-enabled "${servicename}")" = "enabled" ]; then
echodebug "Service ${servicename} is enabled"
return 0
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def run_salt_call(cmd):
try:
result = subprocess.run(cmdl, capture_output=True, text=True)
except TypeError:
result = subprocess.run(cmdl, text=True)
result = subprocess.run(
cmdl, stdout=PIPE, stderr=PIPE, universal_newlines=True
)
print(f"DGM run_salt_call result '{result}'", flush=True)
if 0 == result.returncode:
json_data = json.loads(result.stdout)
Expand Down

0 comments on commit 316e65a

Please sign in to comment.