[Kimchi-devel] [PATCH v3 4/8] Debug Report: Use Generated Time instead of Most Changed Time

Hongliang Wang hlwang at linux.vnet.ibm.com
Fri Jun 13 07:09:56 UTC 2014


Currently debug report generation time is ctime, which stands for change time.
Though getting creation time for file is dependent to platforms, and we'll use
mtime which stands for modification time and for our case because debug report
file will not be modified since it is generated. So mtime suits for our case.

Signed-off-by: Hongliang Wang <hlwang at linux.vnet.ibm.com>
---
 src/kimchi/model/debugreports.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index e5125c9..b9b9d37 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -166,7 +166,7 @@ class DebugReportModel(object):
         except IndexError:
             raise NotFoundError("KCHDR0001E", {'name': name})
 
-        ctime = os.stat(file_target).st_ctime
+        ctime = os.stat(file_target).st_mtime
         ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
         file_target = os.path.split(file_target)[-1]
         file_target = os.path.join("/data/debugreports", file_target)
-- 
1.8.1.4




More information about the Kimchi-devel mailing list