示例#1
0
 def reboot(self):
     with privilege.acquire_privilege(win32security.SE_SHUTDOWN_NAME):
         ret_val = advapi32.InitiateSystemShutdownW(
             0, "Cloudbase-Init reboot", 0, True, True)
         if not ret_val:
             raise exception.WindowsCloudbaseInitException(
                 "Reboot failed: %r")
示例#2
0
 def reboot(self):
     with privilege.acquire_privilege(win32security.SE_SHUTDOWN_NAME):
         ret_val = advapi32.InitiateSystemShutdownW(
             0, "Cloudbase-Init reboot",
             0, True, True)
         if not ret_val:
             raise exception.WindowsCloudbaseInitException(
                 "Reboot failed: %r")
示例#3
0
 def _set_dynamic_time_zone_information(self):
     info = self._get_dynamic_timezone_struct()
     with privilege.acquire_privilege(win32security.SE_TIME_ZONE_NAME):
         kernel32.SetDynamicTimeZoneInformation(ctypes.byref(info))
 def _set_dynamic_time_zone_information(self):
     info = self._get_dynamic_timezone_struct()
     with privilege.acquire_privilege(win32security.SE_TIME_ZONE_NAME):
         kernel32.SetDynamicTimeZoneInformation(ctypes.byref(info))