From 86fe66a2fd7e33a8150821c51a5634f78a1b1ab4 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Mon, 19 Aug 2019 16:31:45 +0300 Subject: [PATCH] Fix pythoncom thread model error The pythoncom thread model is set when pythoncom is imported and cannot be changed afterwards. The removed code was supposed to fix the Windows Nano server, which is currently unsupported by cloudbase-init and thus, no longer necessary. Error log: [WinError -2147417850] Cannot change thread mode after it is set Closes-Bug: #1840659 Change-Id: If278b77a057553c61cada860861e349b2b1fac69 --- cloudbaseinit/shell.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cloudbaseinit/shell.py b/cloudbaseinit/shell.py index 4dfb1f4f..2a25c3c5 100644 --- a/cloudbaseinit/shell.py +++ b/cloudbaseinit/shell.py @@ -12,17 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import struct import sys -if struct.calcsize("P") == 8 and sys.platform == 'win32': - # This is needed by Nano Server. - # Set COINIT_MULTITHREADED only on x64 interpreters due to issues on x86. - # sys.coinit_flags needs to be set before importing pythoncom - sys.coinit_flags = 0 - import pythoncom - pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED) - from oslo_log import log as oslo_logging from cloudbaseinit import conf as cloudbaseinit_conf