[pve-devel] [PATCH] change replica log timestamp to a human readable format

Dominik Csapak d.csapak at proxmox.com
Tue Jun 20 14:27:23 CEST 2017


modeled after the timestamps in vm migration

this does not impact the regression tests, because they
overwrite 'get_log_time' anyway

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Replication.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index 0db427d..5a7274e 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -5,6 +5,7 @@ use strict;
 use Data::Dumper;
 use JSON;
 use Time::HiRes qw(gettimeofday tv_interval);
+use POSIX qw(strftime);
 
 use PVE::INotify;
 use PVE::ProcFSTools;
@@ -19,7 +20,7 @@ use PVE::ReplicationState;
 # regression tests should overwrite this
 sub get_log_time {
 
-    return time();
+    return strftime("%F %H:%M:%S", localtime);
 }
 
 # Find common base replication snapshot, available on local and remote side.
-- 
2.11.0





More information about the pve-devel mailing list