summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-12-23 13:35:07 +0100
committerGitHub <noreply@github.com>2016-12-23 13:35:07 +0100
commit5f1bb42c227396039650e537fb61c3bc4c17476a (patch)
treea94312abdc4b41f22bc407a822f7cc93c0c3d284
parent91c87d3a7a219101abdb14c096a15587b79e5bea (diff)
parent7ca656146965ebb24061f04b040d4588a5754852 (diff)
downloadnextcloud-server-5f1bb42c227396039650e537fb61c3bc4c17476a.tar.gz
nextcloud-server-5f1bb42c227396039650e537fb61c3bc4c17476a.zip
Merge pull request #2846 from nextcloud/downstream-obliterate-legacy-home-fallback
Downstream obliterate legacy home fallback
-rw-r--r--lib/private/Files/Mount/LocalHomeMountProvider.php3
-rw-r--r--lib/private/Files/Storage/Home.php11
-rw-r--r--tests/lib/Files/FilesystemTest.php31
-rw-r--r--tests/lib/Files/Storage/HomeTest.php8
4 files changed, 2 insertions, 51 deletions
diff --git a/lib/private/Files/Mount/LocalHomeMountProvider.php b/lib/private/Files/Mount/LocalHomeMountProvider.php
index 23bbfcd5ffa..9057f62995f 100644
--- a/lib/private/Files/Mount/LocalHomeMountProvider.php
+++ b/lib/private/Files/Mount/LocalHomeMountProvider.php
@@ -39,9 +39,6 @@ class LocalHomeMountProvider implements IHomeMountProvider {
*/
public function getHomeMountForUser(IUser $user, IStorageFactory $loader) {
$arguments = ['user' => $user];
- if (\OC\Files\Cache\Storage::exists('local::' . $user->getHome() . '/')) {
- $arguments['legacy'] = true;
- }
return new MountPoint('\OC\Files\Storage\Home', '/' . $user->getUID(), $arguments, $loader);
}
}
diff --git a/lib/private/Files/Storage/Home.php b/lib/private/Files/Storage/Home.php
index e5ba0f9dfe4..57b32349324 100644
--- a/lib/private/Files/Storage/Home.php
+++ b/lib/private/Files/Storage/Home.php
@@ -44,19 +44,12 @@ class Home extends Local implements \OCP\Files\IHomeStorage {
/**
* Construct a Home storage instance
* @param array $arguments array with "user" containing the
- * storage owner and "legacy" containing "true" if the storage is
- * a legacy storage with "local::" URL instead of the new "home::" one.
+ * storage owner
*/
public function __construct($arguments) {
$this->user = $arguments['user'];
$datadir = $this->user->getHome();
- if (isset($arguments['legacy']) && $arguments['legacy']) {
- // legacy home id (<= 5.0.12)
- $this->id = 'local::' . $datadir . '/';
- }
- else {
- $this->id = 'home::' . $this->user->getUID();
- }
+ $this->id = 'home::' . $this->user->getUID();
parent::__construct(array('datadir' => $datadir));
}
diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php
index dd4785ecf09..df77a0855de 100644
--- a/tests/lib/Files/FilesystemTest.php
+++ b/tests/lib/Files/FilesystemTest.php
@@ -426,37 +426,6 @@ class FilesystemTest extends \Test\TestCase {
if ($user !== null) { $user->delete(); }
}
- /**
- * Tests that the home storage is used in legacy mode
- * for the user's mount point
- */
- public function testLegacyHomeMount() {
- if (getenv('RUN_OBJECTSTORE_TESTS')) {
- $this->markTestSkipped('legacy storage unrelated to objectstore environments');
- }
- $datadir = \OC::$server->getConfig()->getSystemValue("datadirectory", \OC::$SERVERROOT . "/data");
- $userId = $this->getUniqueID('user_');
-
- // insert storage into DB by constructing it
- // to make initMountsPoint find its existence
- $localStorage = new \OC\Files\Storage\Local(array('datadir' => $datadir . '/' . $userId . '/'));
- // this will trigger the insert
- $cache = $localStorage->getCache();
-
- \OC::$server->getUserManager()->createUser($userId, $userId);
- \OC\Files\Filesystem::initMountPoints($userId);
-
- $homeMount = \OC\Files\Filesystem::getStorage('/' . $userId . '/');
-
- $this->assertTrue($homeMount->instanceOfStorage('\OC\Files\Storage\Home'));
- $this->assertEquals('local::' . $datadir . '/' . $userId . '/', $homeMount->getId());
-
- $user = \OC::$server->getUserManager()->get($userId);
- if ($user !== null) { $user->delete(); }
- // delete storage entry
- $cache->clear();
- }
-
public function dummyHook($arguments) {
$path = $arguments['path'];
$this->assertEquals($path, \OC\Files\Filesystem::normalizePath($path)); //the path passed to the hook should already be normalized
diff --git a/tests/lib/Files/Storage/HomeTest.php b/tests/lib/Files/Storage/HomeTest.php
index d9a1b11849e..e6899ff7d38 100644
--- a/tests/lib/Files/Storage/HomeTest.php
+++ b/tests/lib/Files/Storage/HomeTest.php
@@ -89,14 +89,6 @@ class HomeTest extends Storage {
}
/**
- * Tests that the legacy home id is in the format local::/path/to/datadir/user1/
- */
- public function testLegacyId() {
- $this->instance = new \OC\Files\Storage\Home(array('user' => $this->user, 'legacy' => true));
- $this->assertEquals('local::' . $this->tmpDir . '/', $this->instance->getId());
- }
-
- /**
* Tests that getCache() returns an instance of HomeCache
*/
public function testGetCacheReturnsHomeCache() {