I'm not sure if this should be optional.
---
PVE/APIClient/Commands/lxc.pm | 2 ++
PVE/APIClient/Helpers.pm | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/PVE/APIClient/Commands/lxc.pm b/PVE/APIClient/Commands/lxc.pm
index 2309ec0..db618e7 100644
--- a/PVE/APIClient/Commands/lxc.pm
+++ b/PVE/APIClient/Commands/lxc.pm
@@ -446,6 +446,8 @@ __PACKAGE__->register_method ({
print PVE::APIClient::Helpers::poll_task($conn, $node, $upid) . "\n";
+ print PVE::APIClient::Helpers::get_task_log($conn, $node, $upid) . "\n";
+
return undef;
}});
diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm
index 30b8475..606561a 100644
--- a/PVE/APIClient/Helpers.pm
+++ b/PVE/APIClient/Helpers.pm
@@ -339,6 +339,21 @@ sub poll_task {
return $task_status->{exitstatus};
}
+sub get_task_log {
+ my ($conn, $node, $upid) = @_;
+
+ my $path = "api2/json/nodes/$node/tasks/$upid/log";
+
+ my $task_log = $conn->get($path, {});
+
+ my $result = "";
+ for my $li (@$task_log) {
+ $result .= $li->{t} . "\n";
+ }
+
+ return $result;
+}
+
sub configuration_directory {
my $home = $ENV{HOME} // '';
--
2.11.0
_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel