]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
mark decode_utf8_parameters() as depreciated
[pve-common.git] / src / PVE / Tools.pm
index f642286ff61cd458a1fc303779ed0d71b1da2b08..1fe7f4c8ae12e49515d3d27072980f9587cc55d8 100644 (file)
@@ -341,7 +341,7 @@ sub run_command {
     my $timeout;
     my $oldtimeout;
     my $pid;
-    my $exitcode;
+    my $exitcode = -1;
 
     my $outfunc;
     my $errfunc;
@@ -977,6 +977,8 @@ sub decode_text {
     return Encode::decode("utf8", uri_unescape($data));
 }
 
+# depreciated - do not use!
+# we now decode all parameters by default
 sub decode_utf8_parameters {
     my ($param) = @_;
 
@@ -1081,7 +1083,7 @@ sub dump_logfile {
 }
 
 sub dump_journal {
-    my ($start, $limit, $since, $until) = @_;
+    my ($start, $limit, $since, $until, $service) = @_;
 
     my $lines = [];
     my $count = 0;
@@ -1100,6 +1102,7 @@ sub dump_journal {
 
     my $cmd = ['journalctl', '-o', 'short', '--no-pager'];
 
+    push @$cmd, '--unit', $service if $service;
     push @$cmd, '--since', $since if $since;
     push @$cmd, '--until', $until if $until;
     run_command($cmd, outfunc => $parser);