From f2c23ab4fedecd713000f11ed90e5115b6429e6c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 19 Oct 2014 20:16:18 +0100 Subject: [PATCH] Use `salt.utils.fopen()` --- salt/utils/minions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/salt/utils/minions.py b/salt/utils/minions.py index d9b66c06af..eff6479d8c 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -183,9 +183,11 @@ class CkMinions(object): if not greedy: minions.remove(id_) continue - search_results = self.serial.load( - salt.utils.fopen(datap, 'rb') - ).get(search_type) + try: + with salt.utils.fopen(datap, 'rb') as fp_: + search_results = self.serial.load(fp_).get(search_type) + except (IOError, OSError): + continue if not salt.utils.subdict_match(search_results, expr, delimiter,