-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make nextcloud create external storage
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php | ||
index 8fec24996891f..57b2980f1a43f 100644 | ||
--- a/lib/private/Files/Storage/Local.php | ||
+++ b/lib/private/Files/Storage/Local.php | ||
@@ -101,9 +101,13 @@ public function __construct($arguments) { | ||
$this->unlinkOnTruncate = $this->config->getSystemValueBool('localstorage.unlink_on_truncate', false); | ||
|
||
if (isset($arguments['isExternal']) && $arguments['isExternal'] && !$this->stat('')) { | ||
- // data dir not accessible or available, can happen when using an external storage of type Local | ||
- // on an unmounted system mount point | ||
- throw new StorageNotAvailableException('Local storage path does not exist "' . $this->getSourcePath('') . '"'); | ||
+ | ||
+ if (!$this->mkdir('')) { | ||
+ // data dir not accessible or available, can happen when using an external storage of type Local | ||
+ // on an unmounted system mount point | ||
+ throw new StorageNotAvailableException('Local storage path does not exist and could not create it "' . $this->getSourcePath('') . '"'); | ||
+ } | ||
+ \OC::$server->get(LoggerInterface::class)->warning('created local storage path ' . $this->getSourcePath(''), ['app' => 'core']); | ||
} | ||
} | ||
|