Skip to content

Commit

Permalink
Commented out debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphy18 committed Sep 4, 2024
1 parent 8950f30 commit 58c6ed7
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 70 deletions.
6 changes: 3 additions & 3 deletions salt/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2514,9 +2514,9 @@ def syndic_config(
"cachedir": master_opts["cachedir"],
}
opts.update(syndic_opts)
log.warning("DGM syndic_config, user is set to '%s'", opts["user"])
dgm_user = opts["user"]
print(f"DGM syndic_config, user is set to '{dgm_user}'", flush=True)
## 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
90 changes: 45 additions & 45 deletions tests/pytests/pkg/integration/test_salt_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ def test_salt_user_master(install_salt, salt_master):
"""
for count in range(0, 30):
if salt_master.is_running():
print(
f"DGM test_salt_user_master, salt_master is_running, count '{count}'",
flush=True,
)
## DGM print(
## DGM f"DGM test_salt_user_master, salt_master is_running, count '{count}'",
## DGM flush=True,
## DGM )
break
else:
time.sleep(2)

print(
f"DGM test_salt_user_master, salt_master '{salt_master}' and is_running '{salt_master.is_running()}'",
flush=True,
)
## 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,42 +189,42 @@ def test_pkg_paths(

salt_user_subdirs = []

print(
f"DGM test_pkg_paths, pkg_paths '{pkg_paths}', pkg_paths_salt_user '{pkg_paths_salt_user}', exclusions '{pkg_paths_salt_user_exclusions}'",
flush=True,
)

dgm_cmd = "ps -ef"
ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
print(
f"DGM test_pkg_paths, test ps -ef, ret '{ret}'",
flush=True,
)

dgm_cmd = "ls -al /var/log/"
ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
print(
f"DGM test_pkg_paths, test ls -al /var/log/, ret '{ret}'",
flush=True,
)

dgm_cmd = "ls -al /var/log/salt"
ret = salt_call_cli.run("--local", "cmd.run", dgm_cmd)
print(
f"DGM test_pkg_paths, test ls -al /var/log/salt, ret '{ret}'",
flush=True,
)
## 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)

print(
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}'",
flush=True,
)
## 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 (
Expand All @@ -238,10 +238,10 @@ def test_pkg_paths(
# Individual files owned by salt user
for file in files:
file_path = path.joinpath(file)
print(
f"DGM test_pkg_paths, salt:salt file_path '{str(file_path)}', file_path owner '{file_path.owner()}', file_path group '{file_path.group()}'",
flush=True,
)
## 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 +253,10 @@ def test_pkg_paths(
continue
file_path = path.joinpath(file)
# Individual files owned by salt user
print(
f"DGM test_pkg_paths, root:root file_path '{str(file_path)}', file_path owner '{file_path.owner()}', file_path group '{file_path.group()}'",
flush=True,
)
## 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
44 changes: 22 additions & 22 deletions tests/pytests/pkg/integration/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,49 +62,49 @@ 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():
print(
f"DGM test_salt_user_minion, salt_minion is running, final count '{count}'",
flush=True,
)
## 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)

print(
f"DGM test_salt_user_minion, salt_minion '{salt_minion}' and is_running '{salt_minion.is_running()}'",
flush=True,
)
## 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():
print(
f"DGM test_salt_user_minion, salt_master is running, final count '{count}'",
flush=True,
)
## 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)

print(
f"DGM test_salt_user_minion, salt_master '{salt_master}' and is_running '{salt_master.is_running()}'",
flush=True,
)
## 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()

ret = salt_call_cli.run("--local", "test.ping")
print(
f"DGM test_salt_user_minion, salt_call local test.ping ret '{ret}'", flush=True
)
# DGM
## 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
)
print(f"DGM test_salt_user_minion, test.ping ret '{ret}'", flush=True)
## 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 58c6ed7

Please sign in to comment.