Fix check for empty list
Related-Prod: PROD-36116
Change-Id: I9d1a084d8d09a15292444ec8bea55028ab40f6d1
diff --git a/src/com/mirantis/mk/Ceph.groovy b/src/com/mirantis/mk/Ceph.groovy
index fe71d7d..79083bc 100644
--- a/src/com/mirantis/mk/Ceph.groovy
+++ b/src/com/mirantis/mk/Ceph.groovy
@@ -291,8 +291,8 @@
def deleteKeyrings(master, target, extra_tgt='') {
def host = getGrain(master, target, 'host')
- def keys = cmdRun(master, "ceph auth list | grep $host", false).tokenize('\n')
- if(keys.empty()) {
+ def keys = cmdRun(master, "ceph auth list 2>/dev/null | grep $host", false).tokenize('\n')
+ if(keys.isEmpty()) {
new Common().warningMsg("Nothing to do. There is no keyring for $host")
}
for(key in keys) {