File bsc#1114840-0001-Test-CTS-don-t-require-nodes-to-be-specified-if-only.patch of Package pacemaker.15719

From 9c993a7cca76da81448263fdecd78aad2badd06f Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Fri, 16 Nov 2018 09:48:43 -0600
Subject: [PATCH] Test: CTS: don't require nodes to be specified if only
 listing tests

Also, correct a couple of misspellings, avoid a redundant call to
validate(), and call validate() before using the node list in discover().
---
 cts/CTS.py.in      | 2 +-
 cts/environment.py | 9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/cts/CTS.py.in b/cts/CTS.py.in
index de47e82e8..f64d53e4f 100644
--- a/cts/CTS.py.in
+++ b/cts/CTS.py.in
@@ -112,7 +112,7 @@ class CtsLab(object):
 
     This class is derived from a UserDict because we hold many
     different parameters of different kinds, and this provides
-    provide a uniform and extensible interface useful for any kind of
+    a uniform and extensible interface useful for any kind of
     communication between the user/administrator/tester and CTS.
 
     At this point in time, it is the intent of this class to model static
diff --git a/cts/environment.py b/cts/environment.py
index 19573c31e..0ce75136f 100644
--- a/cts/environment.py
+++ b/cts/environment.py
@@ -65,8 +65,9 @@ class Environment(object):
         self.target = "localhost"
 
         self.parse_args(args)
-        self.discover()
-        self.validate()
+        if self["ListTests"] == 0:
+            self.validate()
+            self.discover()
 
     def SeedRandom(self, seed=None):
         if not seed:
@@ -195,7 +196,7 @@ class Environment(object):
             self["at-boot"] = atboot
 
     def detect_ip_offset(self):
-        # Try to determin an offset for IPaddr resources
+        # Try to determine an offset for IPaddr resources
         if self["CIBResource"] and not "IPBase" in self.data:
             network=self.rsh(self.target, "ip addr | grep inet | grep -v -e link -e inet6 -e '/32' -e ' lo' | awk '{print $2}'", stdout=1).strip()
             self["IPBase"] = self.rsh(self.target, "nmap -sn -n %s | grep 'scan report' | awk '{print $NF}' | sed 's:(::' | sed 's:)::' | sort -V | tail -n 1" % network, stdout=1).strip()
@@ -243,8 +244,6 @@ class Environment(object):
         self.detect_at_boot()
         self.detect_ip_offset()
 
-        self.validate()
-
     def parse_args(self, args):
         skipthis=None
 
-- 
2.16.4

openSUSE Build Service is sponsored by