From 66319b972f7520b1fde9d7c09cb4c1f1f6e0cef5 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Fri, 6 Sep 2024 15:59:14 -0600 Subject: [PATCH] Removed commented out debug print statements --- pkg/common/salt-api.service | 1 - salt/config/__init__.py | 8 ---- salt/minion.py | 21 --------- .../pytests/pkg/integration/test_salt_api.py | 1 - .../pytests/pkg/integration/test_salt_user.py | 47 ------------------- tests/pytests/pkg/integration/test_version.py | 24 ---------- 6 files changed, 102 deletions(-) diff --git a/pkg/common/salt-api.service b/pkg/common/salt-api.service index 3e47a2e6366a..d0b6d741202b 100644 --- a/pkg/common/salt-api.service +++ b/pkg/common/salt-api.service @@ -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 diff --git a/salt/config/__init__.py b/salt/config/__init__.py index cd03a3ab745b..8226ba452b80 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -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 = [ diff --git a/salt/minion.py b/salt/minion.py index 64057e81fccc..2c2585637420 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -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_ diff --git a/tests/pytests/pkg/integration/test_salt_api.py b/tests/pytests/pkg/integration/test_salt_api.py index ce9ffce8656e..b13775bd7942 100644 --- a/tests/pytests/pkg/integration/test_salt_api.py +++ b/tests/pytests/pkg/integration/test_salt_api.py @@ -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" diff --git a/tests/pytests/pkg/integration/test_salt_user.py b/tests/pytests/pkg/integration/test_salt_user.py index a8bb166f068e..3978bfe9ca75 100644 --- a/tests/pytests/pkg/integration/test_salt_user.py +++ b/tests/pytests/pkg/integration/test_salt_user.py @@ -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: diff --git a/tests/pytests/pkg/integration/test_version.py b/tests/pytests/pkg/integration/test_version.py index 1c29d033c77c..b7fa262fd53b 100644 --- a/tests/pytests/pkg/integration/test_version.py +++ b/tests/pytests/pkg/integration/test_version.py @@ -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