Merge pull request #253 from fkautz/pr_out_adding_iodine_to_ls_and_mb

This commit is contained in:
Frederick F. Kautz IV
2015-04-06 12:30:05 -07:00
4 changed files with 22 additions and 10 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
{
"ImportPath": "github.com/minio-io/mc",
"GoVersion": "go1.4",
"GoVersion": "go1.4.2",
"Packages": [
"./..."
],
@@ -44,11 +44,11 @@
},
{
"ImportPath": "github.com/minio-io/minio/pkg/utils/log",
"Rev": "183df976f3036f9ea4cb2bddce468c9d16e047bc"
"Rev": "1ebc692ea24cbcb373b9a26837460f0e5efd4780"
},
{
"ImportPath": "github.com/minio-io/minio/pkg/utils/split",
"Rev": "183df976f3036f9ea4cb2bddce468c9d16e047bc"
"Rev": "1ebc692ea24cbcb373b9a26837460f0e5efd4780"
},
{
"ImportPath": "github.com/shiena/ansicolor",
@@ -60,6 +60,9 @@ var std = New(os.Stderr, "", LstdFlags)
// Error is an error logger
var Error = New(os.Stderr, "", 0)
// Debug is an error logger
var Debug = New(os.Stderr, "", 0)
// Trace is an error logger
var Trace = New(os.Stderr, "", 0)
+5 -2
View File
@@ -24,6 +24,7 @@ import (
"github.com/minio-io/cli"
"github.com/minio-io/iodine"
"github.com/minio-io/mc/pkg/client"
"github.com/minio-io/minio/pkg/utils/log"
)
const (
@@ -76,13 +77,15 @@ func doListCmd(ctx *cli.Context) {
if bucketName == "" { // List all buckets
buckets, err := client.ListBuckets()
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
printBuckets(buckets)
} else {
items, err = client.ListObjects(bucketName, objectName)
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
printObjects(items)
}
+11 -5
View File
@@ -20,31 +20,37 @@ import (
"github.com/minio-io/cli"
"github.com/minio-io/iodine"
"github.com/minio-io/mc/pkg/client/s3"
"github.com/minio-io/minio/pkg/utils/log"
)
// doMakeBucketCmd creates a new bucket
func doMakeBucketCmd(ctx *cli.Context) {
urlStr, err := parseURL(ctx.Args().First())
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
bucket, err := url2Bucket(urlStr)
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
clnt, err := getNewClient(globalDebugFlag, urlStr)
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
if !s3.IsValidBucketName(bucket) {
fatal(iodine.New(errInvalidbucket, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(errInvalidbucket.Error())
}
err = clnt.PutBucket(bucket)
if err != nil {
fatal(iodine.New(err, nil))
log.Debug.Println(iodine.New(err, nil))
fatal(err.Error())
}
}