Skip to content

Commit

Permalink
qa/tasks/salt_manager.py: Add Update fuction
Browse files Browse the repository at this point in the history
Adding all_minions_zypper_up_if_needed that performs any pending updates
on the hosts

Signed-off-by: Georgios Kyratsas <gkyratsas@suse.com>
  • Loading branch information
Georgios Kyratsas committed Mar 19, 2020
1 parent 437a144 commit b3d1075
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qa/tasks/salt_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ def all_minions_zypper_status(self):
self.all_minions_zypper_lu()
self.all_minions_zypper_ps()

def all_minions_zypper_up_if_needed(self):
"""
List updates and perform update if needed
"""
zypper_lu = "sudo salt \\* cmd.run \'zypper lu || true\' 2>/dev/null"
zypper_up = "sudo zypper -n up || true\' 2>/dev/null"
output = self.master_remote.sh(zypper_lu)
if 'Nothing to do' not in output:
self.all_minions_cmd_run(zypper_up)

def cat_salt_master_conf(self):
self.__cat_file_remote(self.master_remote, filename="/etc/salt/master")

Expand Down

0 comments on commit b3d1075

Please sign in to comment.