[Kimchi-devel] [PATCH v6 04/10] Debug Report: Use Generated Time instead of Most Changed Time

Hongliang Wang hlwang at linux.vnet.ibm.com
Mon Jul 14 09:45:20 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 10ef233..f37af37 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -167,7 +167,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