Resolves minor functional issues with WindowsClient

* Added steps to bring Windows disks out of read-only
  mode when formatting
* Added missing powershell keyword to create_directory

Change-Id: Icbe46a54216743788131bd8243e1b1e16da49ba0
This commit is contained in:
Daryl Walleck 2014-05-04 00:37:28 -05:00
parent b49a2d4801
commit 8ee44349fd

View File

@ -294,8 +294,9 @@ class WindowsClient(RemoteInstanceClient):
@type path: string
"""
command = 'New-Item -ItemType directory -Path {path}'.format(
path=path)
command = (
'powershell New-Item -ItemType directory '
'-Path {path}'.format(path=path))
output = self.client.execute_command(command)
return output.std_out if output.std_out else None
@ -363,11 +364,14 @@ class WindowsClient(RemoteInstanceClient):
@return: Output of command execution
@rtype: string
"""
command = (
'powershell Set-Disk -Number {disk} '
'-IsOffline $false').format(disk=disk)
self.client.execute_command(command)
command = (
'powershell Set-Disk -Number {disk} '
'-IsReadOnly $false').format(disk=disk)
self.client.execute_command(command)
command = ('powershell Clear-Disk -Number {disk} '
'-RemoveData -Confirm:$false').format(disk=disk)
self.client.execute_command(command)