ceph-deploy: handle stderr from commands better
Currently, we use pushy (http://pypi.python.org/pypi/pushy/ ) for RPC-over-SSH to the target node, and don't really do anything about the stderr of the commands we run on the node.
Current user experience is that sometimes stderr is visible, sometimes not. This seems to be true even for a loop that does the same actions for every entry (though there's a chance the "stderr not seen" was from steps that only needed for the first iteration for a particular host; e.g. if a keyring file is already present, you don't see the noise from putting it in place).
What ever the current situation, unify stderr handling. Ideal:
- no noise on successful run
- see stderr of commands on verbose runs (e.g. "ceph-deploy
v osd ...") see stderr of any full run that failed; that is, for "ceph-deploy osd host1:sdb host2:sdb", if ceph-disk-prepare fails on host2:sdb, we should see full stderr of everything that happened on host2, but none of what happened on host1)
- all stderr output is clearly prefixed to identify what host and what command it is coming from
#4 Updated by Neil Levine about 7 years ago
Some further suggestions:
- stdout should show useful a useful summary about is happening ("Installing packages" rather than "Installing Package ceph-common"), which can be supressed with -q. Shouldn't have DEBUG as a prefix!
- a log should contain the actual detail of actions (eg installing package ceph-common) so failures can be debugged. Log should be on each node (eg /var/log/ceph/ceph-deploy.log). Aggregated log with node id prefixed should be on admin machine running command
- script error should generate a graceful message which points user to the log. We should avoid throwing a bunch of python exception errors to stderr