1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-04 09:33:36 +00:00

vfs: fix vfs/refresh calls with fs= parameter

Before this change rclone gave an error when the fs parameter was
provided.

This change removes the fs parameter from the parameters once it has
been read which avoids the error.

See: https://forum.rclone.org/t/precaching-with-vfs-refresh-fails-with-an-error-when-having-multiple-cloud-drives/20267
This commit is contained in:
Nick Craig-Wood
2020-11-06 16:44:05 +00:00
parent 46ea3d93b5
commit 843d684568
2 changed files with 8 additions and 2 deletions

View File

@@ -57,6 +57,7 @@ func TestRcGetVFS(t *testing.T) {
assert.Contains(t, err.Error(), "more than one VFS active - need")
assert.Nil(t, vfs)
inPresent = rc.Params{"fs": fs.ConfigString(r.Fremote)}
vfs, err = getVFS(inPresent)
require.Error(t, err)
assert.Contains(t, err.Error(), "more than one VFS active with name")
@@ -67,7 +68,8 @@ func TestRcForget(t *testing.T) {
r, vfs, cleanup, call := rcNewRun(t, "vfs/forget")
defer cleanup()
_, _ = r, vfs
out, err := call.Fn(context.Background(), nil)
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
out, err := call.Fn(context.Background(), in)
require.NoError(t, err)
assert.Equal(t, rc.Params{
"forgotten": []string{},
@@ -79,7 +81,8 @@ func TestRcRefresh(t *testing.T) {
r, vfs, cleanup, call := rcNewRun(t, "vfs/refresh")
defer cleanup()
_, _ = r, vfs
out, err := call.Fn(context.Background(), nil)
in := rc.Params{"fs": fs.ConfigString(r.Fremote)}
out, err := call.Fn(context.Background(), in)
require.NoError(t, err)
assert.Equal(t, rc.Params{
"result": map[string]string{