Adds context support for nas, oss and s3

This commit is contained in:
Ersan
2018-03-14 18:36:54 -07:00
committed by kannappanr
parent bdb1a90720
commit 33fe42df8a
6 changed files with 86 additions and 77 deletions

View File

@@ -17,6 +17,8 @@
package nas
import (
"context"
"github.com/minio/cli"
"github.com/minio/minio-go/pkg/policy"
minio "github.com/minio/minio/cmd"
@@ -71,8 +73,8 @@ EXAMPLES:
func nasGatewayMain(ctx *cli.Context) {
// Validate gateway arguments.
host := ctx.Args().First()
if host == "" {
cli.ShowCommandHelpAndExit(ctx, "nas", 1)
if host == "help" {
cli.ShowCommandHelpAndExit(ctx, nasBackend, 1)
}
// Validate gateway arguments.
minio.StartGateway(ctx, &NAS{host})
@@ -114,6 +116,6 @@ func (l *nasObjects) IsNotificationSupported() bool {
}
// GetBucketPolicy will get policy on bucket
func (l *nasObjects) GetBucketPolicy(bucket string) (policy.BucketAccessPolicy, error) {
func (l *nasObjects) GetBucketPolicy(ctx context.Context, bucket string) (policy.BucketAccessPolicy, error) {
return minio.ReadBucketPolicy(bucket, l)
}