From 93be4c10cfce7b0cfdd71228f19c8135404549f9 Mon Sep 17 00:00:00 2001 From: Jorge Schrauwen Date: Sun, 15 Apr 2018 10:09:22 +0200 Subject: [PATCH] Ignore return code in zfs grains When there are no pools zpool list exists with 1. It's possible and OK to have zfs but no have any pools. ``` [ERROR ] Command '/usr/sbin/zpool list -H -o name,size' failed with return code: 1 [ERROR ] output: ``` --- salt/grains/zfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/grains/zfs.py b/salt/grains/zfs.py index 5741bbd8fe..15ceda6ce0 100644 --- a/salt/grains/zfs.py +++ b/salt/grains/zfs.py @@ -60,7 +60,7 @@ def _zfs_pool_data(): flags=['-H'], opts={'-o': 'name,size'}, ) - for zpool in __salt__['cmd.run'](zpool_list_cmd).splitlines(): + for zpool in __salt__['cmd.run'](zpool_list_cmd, ignore_retcode=True).splitlines(): if 'zpool' not in grains: grains['zpool'] = {} zpool = zpool.split()