diff options
-rw-r--r-- | sos/collector/clusters/__init__.py | 10 | ||||
-rw-r--r-- | sos/collector/sosnode.py | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sos/collector/clusters/__init__.py b/sos/collector/clusters/__init__.py index 90e62d79..c4da1ab8 100644 --- a/sos/collector/clusters/__init__.py +++ b/sos/collector/clusters/__init__.py @@ -137,6 +137,16 @@ class Cluster(): """ self.cluster_ssh_key = key + def set_node_options(self, node): + """If there is a need to set specific options on ONLY the non-primary + nodes in a collection, override this method in the cluster profile + and do that here. + + :param node: The non-primary node + :type node: ``SoSNode`` + """ + pass + def set_master_options(self, node): """If there is a need to set specific options in the sos command being run on the cluster's master nodes, override this method in the cluster diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py index 1fc03076..7e784aa1 100644 --- a/sos/collector/sosnode.py +++ b/sos/collector/sosnode.py @@ -657,6 +657,8 @@ class SosNode(): # set master-only options if self.cluster.check_node_is_master(self): self.cluster.set_master_options(self) + else: + self.cluster.set_node_options(self) def finalize_sos_cmd(self): """Use host facts and compare to the cluster type to modify the sos @@ -713,13 +715,13 @@ class SosNode(): sos_opts.append('--cmd-timeout=%s' % quote(str(self.opts.cmd_timeout))) + self.update_cmd_from_cluster() + sos_cmd = sos_cmd.replace( 'sosreport', os.path.join(self.host.sos_bin_path, self.sos_bin) ) - self.update_cmd_from_cluster() - if self.opts.only_plugins: plugs = [o for o in self.opts.only_plugins if self._plugin_exists(o)] |