From 8ee44349fd3e551d2d18fa1e9c1e850fc38c8ec0 Mon Sep 17 00:00:00 2001 From: Daryl Walleck Date: Sun, 4 May 2014 00:37:28 -0500 Subject: [PATCH] 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 --- .../clients/remote_instance/windows/windows_client.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py b/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py index 5e695c76..ad000c1c 100644 --- a/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py +++ b/cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py @@ -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)