+ elif ask_key:
+ options.extend([
+ "-oStrictHostKeyChecking=ask",
+ ])
+
+ return options
+
+ def BuildCmd(self, hostname, user, command, batch=True, ask_key=False,
+ tty=False, use_cluster_key=True, strict_host_check=True):
+ """Build an ssh command to execute a command on a remote node.
+
+ @param hostname: the target host, string
+ @param user: user to auth as
+ @param command: the command
+ @param batch: if true, ssh will run in batch mode with no prompting
+ @param ask_key: if true, ssh will run with
+ StrictHostKeyChecking=ask, so that we can connect to an
+ unknown host (not valid in batch mode)
+ @param use_cluster_key: whether to expect and use the
+ cluster-global SSH key
+ @param strict_host_check: whether to check the host's SSH key at all
+
+ @return: the ssh call to run 'command' on the remote host.