From ec8a8cd0d62af7fd8621a437ac19b0b294e62069 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Fri, 3 Feb 2017 22:04:27 +0200 Subject: [PATCH] Fix win2k16 extend volume during specialize The WMI api used to enumerate volumes on 2016 is not available during the specialize step. The WMI namespace in cause is '//./Root/Microsoft/Windows/Storage' We need to fallback on win2k16 to the previous used storage management (VDS). Change-Id: Ib082443c34dcba64697f165c9b2902f3f61c7e39 Closes-bug: #1661725 --- cloudbaseinit/tests/utils/windows/storage/test_factory.py | 2 +- cloudbaseinit/utils/windows/storage/factory.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbaseinit/tests/utils/windows/storage/test_factory.py b/cloudbaseinit/tests/utils/windows/storage/test_factory.py index 987d21db..d189bf46 100644 --- a/cloudbaseinit/tests/utils/windows/storage/test_factory.py +++ b/cloudbaseinit/tests/utils/windows/storage/test_factory.py @@ -47,7 +47,7 @@ class TestStorageManager(unittest.TestCase): return self.mock_os.name = "nt" - mock_get_os_utils.return_value.check_os_version.return_value = nano + mock_get_os_utils.return_value.is_nano_server.return_value = nano mock_load_class = mock_class_loader.return_value.load_class response = self.factory.get_storage_manager() if nano: diff --git a/cloudbaseinit/utils/windows/storage/factory.py b/cloudbaseinit/utils/windows/storage/factory.py index a2d176ed..1c33a00a 100644 --- a/cloudbaseinit/utils/windows/storage/factory.py +++ b/cloudbaseinit/utils/windows/storage/factory.py @@ -30,7 +30,7 @@ def get_storage_manager(): cl = classloader.ClassLoader() if os.name == "nt": - if osutils.check_os_version(10, 0): + if osutils.is_nano_server(): # VDS is not available on Nano Server # WSM supersedes VDS since Windows Server 2012 / Windows 8 return cl.load_class(class_paths["WSM"])()