mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Removed commented out debug print statements
This commit is contained in:
parent
1ebd3c6b8e
commit
a7da90d8f6
6 changed files with 0 additions and 102 deletions
|
@ -2,7 +2,6 @@
|
|||
Description=The Salt API
|
||||
Documentation=man:salt-api(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltproject.io/en/latest/contents.html
|
||||
After=network.target
|
||||
# DGM PartOf=salt-master.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
|
|
|
@ -2502,11 +2502,6 @@ def syndic_config(
|
|||
),
|
||||
)
|
||||
),
|
||||
## DGM line to force rebuild
|
||||
# DGM conf/suse/master has syndic_user for running syndic as a different user
|
||||
# DGM use urrently set it to 'salt'
|
||||
# DGM testing getting the master_opts user, and run syndic as that
|
||||
# DGM "user": opts.get("syndic_user", opts["user"]),
|
||||
"user": opts.get("syndic_user", master_opts["user"]),
|
||||
"sock_dir": os.path.join(
|
||||
opts["cachedir"], opts.get("syndic_sock_dir", opts["sock_dir"])
|
||||
|
@ -2515,9 +2510,6 @@ def syndic_config(
|
|||
"cachedir": master_opts["cachedir"],
|
||||
}
|
||||
opts.update(syndic_opts)
|
||||
## DGM log.warning("DGM syndic_config, user is set to '%s'", opts["user"])
|
||||
## DGM dgm_user = opts["user"]
|
||||
## DGM print(f"DGM syndic_config, user is set to '{dgm_user}'", flush=True)
|
||||
|
||||
# Prepend root_dir to other paths
|
||||
prepend_root_dirs = [
|
||||
|
|
|
@ -280,11 +280,6 @@ def get_proc_dir(cachedir, **kwargs):
|
|||
gid. Must be int. Works only on unix/unix like systems.
|
||||
"""
|
||||
# pylint: disable=logging-fstring-interpolation
|
||||
## DGM log.warning(f"DGM get_proc_dir entry, cachedir '{cachedir}', kwargs '{kwargs}'")
|
||||
## DGM print(
|
||||
## DGM f"DGM get_proc_dir entry, cachedir '{cachedir}', kwargs '{kwargs}'", flush=True
|
||||
## DGM )
|
||||
|
||||
fn_ = os.path.join(cachedir, "proc")
|
||||
mode = kwargs.pop("mode", None)
|
||||
|
||||
|
@ -312,28 +307,12 @@ def get_proc_dir(cachedir, **kwargs):
|
|||
gid = kwargs.pop("gid", -1)
|
||||
|
||||
# pylint: disable=logging-fstring-interpolation
|
||||
## DGM log.warning(
|
||||
## DGM f"DGM get_proc_dir chown, d_stat '{d_stat}', uid '{uid}', gid '{gid}'"
|
||||
## DGM )
|
||||
## DGM print(
|
||||
## DGM f"DGM get_proc_dir chown, d_stat '{d_stat}', uid '{uid}', gid '{gid}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
# if uid and gid are both -1 then go ahead with
|
||||
# no changes at all
|
||||
if (d_stat.st_uid != uid or d_stat.st_gid != gid) and [
|
||||
i for i in (uid, gid) if i != -1
|
||||
]:
|
||||
# pylint: disable=logging-fstring-interpolation
|
||||
## DGM log.warning(
|
||||
## DGM f"DGM get_proc_dir chown file, file '{fn_}' , uid '{uid}', gid '{gid}'"
|
||||
## DGM )
|
||||
## DGM print(
|
||||
## DGM f"DGM get_proc_dir chown file, file '{fn_}' , uid '{uid}', gid '{gid}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
os.chown(fn_, uid, gid)
|
||||
|
||||
return fn_
|
||||
|
|
|
@ -9,7 +9,6 @@ def test_salt_api(api_request, install_salt, salt_master):
|
|||
"""
|
||||
Test running a command against the salt api
|
||||
"""
|
||||
# DGM TBD 66672 is merged, need to remove this check and see if test passes
|
||||
if install_salt.distro_id in ("ubuntu", "debian"):
|
||||
pytest.skip(
|
||||
"Package test are getting reworked in https://github.com/saltstack/salt/issues/66672"
|
||||
|
|
|
@ -94,18 +94,10 @@ def test_salt_user_master(install_salt, salt_master):
|
|||
"""
|
||||
for count in range(0, 30):
|
||||
if salt_master.is_running():
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_master, salt_master is_running, count '{count}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
break
|
||||
else:
|
||||
time.sleep(2)
|
||||
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_master, salt_master '{salt_master}' and is_running '{salt_master.is_running()}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
assert salt_master.is_running()
|
||||
|
||||
match = False
|
||||
|
@ -189,43 +181,12 @@ def test_pkg_paths(
|
|||
|
||||
salt_user_subdirs = []
|
||||
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, pkg_paths '{pkg_paths}', pkg_paths_salt_user '{pkg_paths_salt_user}', exclusions '{pkg_paths_salt_user_exclusions}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
## DGM dgm_cmd = "ps -ef"
|
||||
## DGM ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, test ps -ef, ret '{ret}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
## DGM dgm_cmd = "ls -al /var/log/"
|
||||
## DGM ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, test ls -al /var/log/, ret '{ret}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
## DGM dgm_cmd = "ls -al /var/log/salt"
|
||||
## DGM ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, test ls -al /var/log/salt, ret '{ret}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
for _path in pkg_paths:
|
||||
pkg_path = pathlib.Path(_path)
|
||||
assert pkg_path.exists()
|
||||
for dirpath, sub_dirs, files in os.walk(pkg_path):
|
||||
path = pathlib.Path(dirpath)
|
||||
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, dirpath '{str(dirpath)}', path '{str(path)}', path owner '{path.owner()}', path group '{path.group()}', salt_user_subdirs '{salt_user_subdirs}', sub_dirs '{sub_dirs}', files '{files}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
|
||||
# Directories owned by salt:salt or their subdirs/files
|
||||
if (
|
||||
str(path) in pkg_paths_salt_user or str(path) in salt_user_subdirs
|
||||
|
@ -238,10 +199,6 @@ def test_pkg_paths(
|
|||
# Individual files owned by salt user
|
||||
for file in files:
|
||||
file_path = path.joinpath(file)
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, salt:salt file_path '{str(file_path)}', file_path owner '{file_path.owner()}', file_path group '{file_path.group()}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
if str(file_path) not in pkg_paths_salt_user_exclusions:
|
||||
assert file_path.owner() == "salt"
|
||||
# Directories owned by root:root
|
||||
|
@ -253,10 +210,6 @@ def test_pkg_paths(
|
|||
continue
|
||||
file_path = path.joinpath(file)
|
||||
# Individual files owned by salt user
|
||||
## DGM print(
|
||||
## DGM f"DGM test_pkg_paths, root:root file_path '{str(file_path)}', file_path owner '{file_path.owner()}', file_path group '{file_path.group()}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
if str(file_path) in pkg_paths_salt_user:
|
||||
assert file_path.owner() == "salt"
|
||||
else:
|
||||
|
|
|
@ -62,49 +62,25 @@ def test_salt_versions_report_minion(salt_cli, salt_call_cli, salt_master, salt_
|
|||
# Make sure the minion is running
|
||||
for count in range(0, 30):
|
||||
if salt_minion.is_running():
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_minion, salt_minion is running, final count '{count}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
break
|
||||
else:
|
||||
time.sleep(2)
|
||||
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_minion, salt_minion '{salt_minion}' and is_running '{salt_minion.is_running()}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
assert salt_minion.is_running()
|
||||
|
||||
# DGM
|
||||
# Make sure the master is running
|
||||
for count in range(0, 30):
|
||||
if salt_master.is_running():
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_minion, salt_master is running, final count '{count}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
break
|
||||
else:
|
||||
time.sleep(2)
|
||||
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_minion, salt_master '{salt_master}' and is_running '{salt_master.is_running()}'",
|
||||
## DGM flush=True,
|
||||
## DGM )
|
||||
assert salt_master.is_running()
|
||||
|
||||
## DGM ret = salt_call_cli.run("--local", "test.ping")
|
||||
## DGM print(
|
||||
## DGM f"DGM test_salt_user_minion, salt_call local test.ping ret '{ret}'", flush=True
|
||||
## DGM )
|
||||
## DGM # DGM
|
||||
|
||||
# Make sure we can ping the minion ...
|
||||
ret = salt_cli.run(
|
||||
"--timeout=600", "test.ping", minion_tgt=salt_minion.id, _timeout=600
|
||||
)
|
||||
## DGM print(f"DGM test_salt_user_minion, test.ping ret '{ret}'", flush=True)
|
||||
|
||||
assert ret.returncode == 0
|
||||
assert ret.data is True
|
||||
|
|
Loading…
Add table
Reference in a new issue