Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuse: make osxfuse check config check more permissive #3098

Merged
merged 1 commit into from
Aug 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions fuse/node/mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ trying to run these checks with:
[3]: %s
`

var errStrFixConfig = `config key invalid: %s %s
var errStrFixConfig = `config key invalid: %s %v
You may be able to get this error to go away by setting it again:

ipfs config %s true
Expand Down Expand Up @@ -221,12 +221,15 @@ func userAskedToSkipFuseCheck(node *core.IpfsNode) (skip bool, err error) {
if err != nil {
return false, nil // failed to get config value. dont skip check.
}
s, ok := val.(string)
if !ok {

switch val := val.(type) {
case string:
return val == "true", nil
case bool:
return val, nil
default:
// got config value, but it's invalid... dont skip check, ask the user to fix it...
return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
dontCheckOSXFUSEConfigKey)
}
// only "true" counts as telling us to skip.
return s == "true", nil
}