fixes
Change-Id: Ia1106b7fef91b5b252e8c4f69f4ea524a9e0c26b
This commit is contained in:
parent
bc9fd003f5
commit
c0371678aa
|
@ -57,7 +57,7 @@ class WindowsConfigDriveManager(base.BaseConfigDriveManager):
|
|||
|
||||
def _meta_data_file_exists(self, drive, metadata_file):
|
||||
if self._osutils._has_cdfs(drive):
|
||||
LOG.debug("Drive %s has cdfs. Respecting upper-case file names when looking for meta-data.")
|
||||
LOG.debug("Drive %s has cdfs. Respecting upper-case file names when looking for meta-data." % drive)
|
||||
metadata_file = self._to_cdfs_filename(metadata_file)
|
||||
|
||||
if os.path.exists(os.path.join(drive, metadata_file)):
|
||||
|
@ -169,7 +169,7 @@ class WindowsConfigDriveManager(base.BaseConfigDriveManager):
|
|||
os.rmdir(self.target_path)
|
||||
shutil.copytree(drive_letter, self.target_path)
|
||||
LOG.debug("Renaming local copy of cdfs file names to lower-case.")
|
||||
for file in os.listdir():
|
||||
for file in os.listdir(self.target_path):
|
||||
shutil.move(os.path.join(self.target_path, file), os.path.join(self.target_path, self._from_cdfs_filename(file)))
|
||||
|
||||
return True
|
||||
|
|
|
@ -1482,11 +1482,12 @@ class WindowsUtils(base.BaseOSUtils):
|
|||
|
||||
def _has_cdfs(self, drive):
|
||||
out,err,code = self.execute_powershell_command("wmic logicaldisk get deviceid,filesystem")
|
||||
LOG.info("Checking if drive %s has CDFS filesystem" % drive)
|
||||
if code == 0:
|
||||
lines = out.decode('ascii').replace('\r\r','').splitlines()[1:] # skip header line
|
||||
for line in lines:
|
||||
drive_fs = line.split()
|
||||
LOG.info("Checking drive/fs combination %s/%s" % (drive_fs[0], drive_fs[1]))
|
||||
LOG.info("Found candidate %s with %s" % (drive_fs[0], drive_fs[1]))
|
||||
|
||||
if drive.startswith(drive_fs[0].upper()) and drive_fs[1].upper() == "CDFS":
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue