54
54
ps_cmd = "ps fauxww | sudo tee /var/log/ps-fauxww.txt"
56
56
log.info("Collecting ps output on unit {}".format(unit))
57
check_output(["juju", "ssh", unit, ps_cmd], stderr=STDOUT)
57
check_output(["juju", "ssh", unit, "-v", ps_cmd], stderr=STDOUT)
58
58
except CalledProcessError as e:
60
60
"Failed to collect running processes on unit {}".format(unit))
77
77
tar_cmd, exclude, logsuffix, logs)
79
79
log.info("Creating tarball on unit {}".format(unit))
80
check_output(["juju", "ssh", unit, cmd], stderr=STDOUT)
80
check_output(["juju", "ssh", unit, "-v", cmd], stderr=STDOUT)
81
81
except CalledProcessError as e:
83
83
"Failed to create remote log tarball on unit {}".format(unit))
139
139
log.info("Found landscape unit %s" % landscape_unit)
141
check_output(["juju", "ssh", landscape_unit, poke_inner_env])
141
check_output(["juju", "ssh", "-v", landscape_unit, poke_inner_env])
142
142
except CalledProcessError:
143
143
log.info("No active inner environment found on %s, skipping" %
146
146
call(["juju", "scp", PRG, "%s:%s" % (landscape_unit, collect_logs)])
147
call(["juju", "ssh", landscape_unit, "sudo rm -rf /tmp/inner-logs.tar.*"])
147
call(["juju", "ssh", landscape_unit, "-v",
148
"sudo rm -rf /tmp/inner-logs.tar.*"])
148
149
log.info("Collecting Logs on inner environment")
150
["juju", "ssh", landscape_unit, "sudo -u landscape %s" % collect_run])
151
["juju", "ssh", landscape_unit, "-v",
152
"sudo -u landscape %s" % collect_run])
151
153
log.info("Copying inner environment back")
152
154
check_call(["juju", "scp", "%s:/tmp/inner-logs.tar.gz" % landscape_unit,