Skip to content

Commit

Permalink
Removed commented out debug print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Sep 6, 2024
1 parent 4b690bf commit 66319b9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 102 deletions.
1 change: 0 additions & 1 deletion pkg/common/salt-api.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand All @@ -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 = [
Expand Down
21 changes: 0 additions & 21 deletions salt/minion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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_
Expand Down
1 change: 0 additions & 1 deletion tests/pytests/pkg/integration/test_salt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
47 changes: 0 additions & 47 deletions tests/pytests/pkg/integration/test_salt_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
24 changes: 0 additions & 24 deletions tests/pytests/pkg/integration/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66319b9

Please sign in to comment.