From 2075a76a0f5643652bd12bd21598f2de52af1755 Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <skalkoto@grnet.gr>
Date: Thu, 11 Jul 2013 10:16:58 +0300
Subject: [PATCH] Add sysprep in windows to clear the event logs

---
 image_creator/os_type/windows.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/image_creator/os_type/windows.py b/image_creator/os_type/windows.py
index ad45afd..4b77751 100644
--- a/image_creator/os_type/windows.py
+++ b/image_creator/os_type/windows.py
@@ -104,6 +104,13 @@ class Windows(OSBase):
         self._guest_exec(
             r'REG ADD %s /v RealTimeIsUniversal /t REG_DWORD /d 1 /f' % path)
 
+    @sysprep('Clearing the event logs')
+    def clear_logs(self):
+        """Clear all the event logs"""
+
+        self._guest_exec(
+            r"cmd /q /c for /f %l in ('wevtutil el') do wevtutil cl %l")
+
     @sysprep('Executing sysprep on the image (may take more that 10 minutes)')
     def microsoft_sysprep(self):
         """Run the Microsoft System Preparation Tool. This will remove
-- 
GitLab