mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-09 22:31:53 +00:00
Updated tests, and debugging, min Python version 3.6
This commit is contained in:
parent
0075aa9902
commit
316e65a979
3 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue