Page MenuHomePhabricator

D10510.diff
No OneTemporary

D10510.diff

diff --git a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php
@@ -861,9 +861,17 @@
'Releasing lease %d',
$lease->getID()));
- $cmd = $lease->getInterface('command');
$path = $lease->getAttribute('path');
+ // Set the path back to null for the lease. This ensures on Windows
+ // machines we don't change to the directory we're about to delete, because
+ // Windows implicitly locks a directory from deletion whenever there is a
+ // process with it's current working directory within that directory or
+ // any of it's sub-directories.
+ $lease->setAttribute('path', null);
+
+ $cmd = $lease->getInterface('command');
+
try {
$this->log(pht(
'Removing contents of \'%s\' on host',
@@ -883,7 +891,12 @@
'occur when files are locked by the operating system. The exception '.
'message was \'%s\'.',
$ex->getMessage()));
+ return;
}
+
+ $this->log(pht(
+ 'Removed contents of \'%s\' on host successfully',
+ $path));
}
public function getType() {

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 11:40 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7708317
Default Alt Text
D10510.diff (1 KB)

Event Timeline