From 6fda4edeb743babfed4ff9de374b1ba0374b317f Mon Sep 17 00:00:00 2001 From: Joe Grund Date: Tue, 23 Apr 2019 07:39:03 -0500 Subject: [PATCH] Add remove-packages action (#83) Add the ability to remove packages to the agent. --- chroma_agent/action_plugins/agent_updates.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chroma_agent/action_plugins/agent_updates.py b/chroma_agent/action_plugins/agent_updates.py index 00cd9b6..a245c2e 100644 --- a/chroma_agent/action_plugins/agent_updates.py +++ b/chroma_agent/action_plugins/agent_updates.py @@ -95,6 +95,13 @@ def update_profile(profile): return agent_result_ok +def remove_packages(packages): + if packages != []: + yum_util("remove", packages=packages) + + return agent_result_ok + + def install_packages(repos, packages): """ Explicitly evaluate and install or update any specific-version dependencies and satisfy even if @@ -224,6 +231,7 @@ def _shutdown(): configure_repo, unconfigure_repo, install_packages, + remove_packages, kernel_status, restart_agent, update_profile,