Răsfoiți Sursa

Fix storage rescan

On older Windows systems there is no Update-HostStorageCache
commandlet. This replaces the powershell rescan with a diskpart
equivalent.
Gabriel-Adrian Samfira 6 ani în urmă
părinte
comite
592910afeb
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  1. 1 2
      coriolis/osmorphing/osmount/windows.py

+ 1 - 2
coriolis/osmorphing/osmount/windows.py

@@ -54,8 +54,7 @@ class WindowsMountTools(base.BaseOSMountTools):
             pass
             pass
 
 
     def _refresh_storage(self):
     def _refresh_storage(self):
-        self._conn.exec_ps_command(
-            "Update-HostStorageCache", ignore_stdout=True)
+        self._run_diskpart_script("RESCAN")
 
 
     def _run_diskpart_script(self, script):
     def _run_diskpart_script(self, script):
         """Executes the given script with diskpart.exe.
         """Executes the given script with diskpart.exe.