]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/cluster: be explicit that a positional argument is needed 1541/head
authorKefu Chai <kchai@redhat.com>
Fri, 31 Jul 2020 05:05:15 +0000 (13:05 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 31 Jul 2020 05:05:20 +0000 (13:05 +0800)
otherwise the caller may run into

sh() missing 1 required positional argument: 'script'

if the developer only check the function signature of Cluster.sh().

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/orchestra/cluster.py

index 50e078cd8ecdb3fc69a4750072c3338e8ca3cfa3..dbc74de021dbbaa98b18dce3f023772426d41db4 100644 (file)
@@ -63,7 +63,7 @@ class Cluster(object):
         remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
         return [remote.run(**kwargs) for remote in remotes]
 
-    def sh(self, **kwargs):
+    def sh(self, script, **kwargs):
         """
         Run a command on all the nodes in this cluster.
 
@@ -72,7 +72,7 @@ class Cluster(object):
         Returns a list of the command outputs correspondingly.
         """
         remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
-        return [remote.sh(**kwargs) for remote in remotes]
+        return [remote.sh(script, **kwargs) for remote in remotes]
 
     def write_file(self, file_name, content, sudo=False, perms=None, owner=None):
         """