Updated tests, and debugging, min Python version 3.6

This commit is contained in:
David Murphy 2024-12-12 10:24:19 -07:00
parent 0075aa9902
commit 316e65a979
No known key found for this signature in database
GPG key ID: 9D7724F37A7424D8
3 changed files with 14 additions and 4 deletions

View file

@ -41,8 +41,10 @@ repos:
rev: v3.15.0 rev: v3.15.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
name: Rewrite Code to be Py3.9+ name: Rewrite Code to be Py3.6+
args: [--py39-plus] args: [--py36-plus]
## DGM name: Rewrite Code to be Py3.9+
## DGM args: [--py39-plus]
- repo: https://github.com/asottile/reorder_python_imports - repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0 rev: v3.12.0

View file

@ -26,7 +26,7 @@
#====================================================================================================================== #======================================================================================================================
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
__ScriptVersion="2024.12.09" __ScriptVersion="2024.12.12"
__ScriptName="bootstrap-salt.sh" __ScriptName="bootstrap-salt.sh"
__ScriptFullName="$0" __ScriptFullName="$0"
@ -2468,6 +2468,12 @@ __check_services_systemd() {
servicename=$1 servicename=$1
echodebug "Checking if service ${servicename} is enabled" 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 if [ "$(systemctl is-enabled "${servicename}")" = "enabled" ]; then
echodebug "Service ${servicename} is enabled" echodebug "Service ${servicename} is enabled"
return 0 return 0

View file

@ -45,7 +45,9 @@ def run_salt_call(cmd):
try: try:
result = subprocess.run(cmdl, capture_output=True, text=True) result = subprocess.run(cmdl, capture_output=True, text=True)
except TypeError: 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) print(f"DGM run_salt_call result '{result}'", flush=True)
if 0 == result.returncode: if 0 == result.returncode:
json_data = json.loads(result.stdout) json_data = json.loads(result.stdout)