File 0003-medium-ui_cluster-Fix-init-with-no-arguments-bsc-102.patch of Package crmsh

From 5ea0f8480fc7bb9894e0581ef3e0afa3b3ea11e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Thu, 9 Mar 2017 21:49:09 +0100
Subject: [PATCH 3/4] medium: ui_cluster: Fix init with no arguments
 (bsc#1028735)

---
 crmsh/ui_cluster.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crmsh/ui_cluster.py b/crmsh/ui_cluster.py
index 762e6bfd..6b143c35 100644
--- a/crmsh/ui_cluster.py
+++ b/crmsh/ui_cluster.py
@@ -104,8 +104,9 @@ class Cluster(command.UI):
         def looks_like_hostnames(lst):
             sectionlist = bootstrap.INIT_STAGES
             return all(not (l.startswith('-') or l in sectionlist) for l in lst)
-        if '--dry-run' in args or looks_like_hostnames(args):
-            args = ['--yes', '--nodes'] + [arg for arg in args if arg != '--dry-run']
+        if len(args) > 0:
+            if '--dry-run' in args or looks_like_hostnames(args):
+                args = ['--yes', '--nodes'] + [arg for arg in args if arg != '--dry-run']
         parser = OptParser(usage="usage: init [options] [STAGE]", epilog="""
 
 Stage can be one of:
-- 
2.11.1

openSUSE Build Service is sponsored by