From ea5ce2756494d802f45e85224ce1a05939557d03 Mon Sep 17 00:00:00 2001 From: Alexey Guskov Date: Tue, 2 Jun 2015 10:37:38 +0300 Subject: [PATCH] update go-zfs to last version Signed-off-by: Alexey Guskov --- hack/vendor.sh | 2 +- vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md | 9 +++++++++ vendor/src/github.com/mistifyio/go-zfs/utils.go | 2 +- vendor/src/github.com/mistifyio/go-zfs/zfs.go | 4 ++-- vendor/src/github.com/mistifyio/go-zfs/zfs_test.go | 6 ++++-- vendor/src/github.com/mistifyio/go-zfs/zpool.go | 3 --- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/hack/vendor.sh b/hack/vendor.sh index 488629d31f..a8883ab510 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -49,7 +49,7 @@ clone git github.com/go-check/check 64131543e7896d5bcc6bd5a76287eb75ea96c673 clone git github.com/gorilla/context 14f550f51a clone git github.com/gorilla/mux e444e69cbd clone git github.com/kr/pty 5cf931ef8f -clone git github.com/mistifyio/go-zfs v2.1.0 +clone git github.com/mistifyio/go-zfs v2.1.1 clone git github.com/tchap/go-patricia v2.1.0 clone hg code.google.com/p/go.net 84a4013f96e0 clone hg code.google.com/p/gosqlite 74691fb6f837 diff --git a/vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md b/vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md index 66aab8e359..f1880c19e5 100644 --- a/vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md +++ b/vendor/src/github.com/mistifyio/go-zfs/CONTRIBUTING.md @@ -47,5 +47,14 @@ Push your feature branch to your fork. **Important:** By submitting a patch, you agree to allow the project owners to license your work under the [Apache 2.0 License](./LICENSE). +### Go Tools ### +For consistency and to catch minor issues for all of go code, please run the following: +* goimports +* go vet +* golint +* errcheck + +Many editors can execute the above on save. + ---- Guidelines based on http://azkaban.github.io/contributing.html diff --git a/vendor/src/github.com/mistifyio/go-zfs/utils.go b/vendor/src/github.com/mistifyio/go-zfs/utils.go index 250bd5b31c..d5b7353494 100644 --- a/vendor/src/github.com/mistifyio/go-zfs/utils.go +++ b/vendor/src/github.com/mistifyio/go-zfs/utils.go @@ -264,7 +264,7 @@ func parseInodeChanges(lines [][]string) ([]*InodeChange, error) { } func listByType(t, filter string) ([]*Dataset, error) { - args := []string{"get", "all", "-t", t, "-rHp"} + args := []string{"get", "-rHp", "-t", t, "all"} if filter != "" { args = append(args, filter) } diff --git a/vendor/src/github.com/mistifyio/go-zfs/zfs.go b/vendor/src/github.com/mistifyio/go-zfs/zfs.go index f43bea292e..a1d740e07e 100644 --- a/vendor/src/github.com/mistifyio/go-zfs/zfs.go +++ b/vendor/src/github.com/mistifyio/go-zfs/zfs.go @@ -137,7 +137,7 @@ func Volumes(filter string) ([]*Dataset, error) { // GetDataset retrieves a single ZFS dataset by name. This dataset could be // any valid ZFS dataset type, such as a clone, filesystem, snapshot, or volume. func GetDataset(name string) (*Dataset, error) { - out, err := zfs("get", "all", "-Hp", name) + out, err := zfs("get", "-Hp", "all", name) if err != nil { return nil, err } @@ -335,7 +335,7 @@ func (d *Dataset) Rollback(destroyMoreRecent bool) error { // A recursion depth may be specified, or a depth of 0 allows unlimited // recursion. func (d *Dataset) Children(depth uint64) ([]*Dataset, error) { - args := []string{"get", "all", "-t", "all", "-Hp"} + args := []string{"get", "-t", "all", "-Hp", "all"} if depth > 0 { args = append(args, "-d") args = append(args, strconv.FormatUint(depth, 10)) diff --git a/vendor/src/github.com/mistifyio/go-zfs/zfs_test.go b/vendor/src/github.com/mistifyio/go-zfs/zfs_test.go index e991a5cffc..41b4fb1b72 100644 --- a/vendor/src/github.com/mistifyio/go-zfs/zfs_test.go +++ b/vendor/src/github.com/mistifyio/go-zfs/zfs_test.go @@ -262,8 +262,10 @@ func TestChildren(t *testing.T) { func TestListZpool(t *testing.T) { zpoolTest(t, func() { - _, err := zfs.ListZpools() + pools, err := zfs.ListZpools() ok(t, err) + equals(t, "test", pools[0].Name) + }) } @@ -292,7 +294,7 @@ func TestRollback(t *testing.T) { ok(t, err) err = s1.Rollback(false) - assert(t, ok != nil, "should error when rolling back beyond most recent without destroyMoreRecent = true") + assert(t, err != nil, "should error when rolling back beyond most recent without destroyMoreRecent = true") err = s1.Rollback(true) ok(t, err) diff --git a/vendor/src/github.com/mistifyio/go-zfs/zpool.go b/vendor/src/github.com/mistifyio/go-zfs/zpool.go index 59be0a84ce..6ba52d30cb 100644 --- a/vendor/src/github.com/mistifyio/go-zfs/zpool.go +++ b/vendor/src/github.com/mistifyio/go-zfs/zpool.go @@ -92,9 +92,6 @@ func ListZpools() ([]*Zpool, error) { return nil, err } - // there is no -H - out = out[1:] - var pools []*Zpool for _, line := range out {