util: Port all code to new errwrap package

This should keep things more uniform.
This commit is contained in:
James Shubin
2019-03-12 16:09:14 -04:00
parent 54c81d6bb2
commit 880652f5d4
97 changed files with 109 additions and 136 deletions

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -32,10 +32,10 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/util"
"github.com/purpleidea/mgmt/util/errwrap"
"github.com/davecgh/go-spew/spew"
"github.com/kylelemons/godebug/pretty"
errwrap "github.com/pkg/errors"
)
func TestPureFuncExec0(t *testing.T) {

View File

@@ -29,8 +29,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -24,8 +24,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/util"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -26,8 +26,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/recwatch"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -25,8 +25,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

View File

@@ -28,9 +28,9 @@ import (
"github.com/purpleidea/mgmt/lang/funcs/facts"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/util/errwrap"
"github.com/purpleidea/mgmt/util/socketset"
errwrap "github.com/pkg/errors"
"golang.org/x/sys/unix"
)

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs/facts"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs/facts"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -28,8 +28,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs/simple"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
var (

View File

@@ -23,8 +23,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -23,8 +23,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
func init() {

View File

@@ -37,8 +37,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -26,9 +26,9 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/pgraph"
"github.com/purpleidea/mgmt/util/errwrap"
multierr "github.com/hashicorp/go-multierror"
errwrap "github.com/pkg/errors"
)
// State represents the state of a function vertex. This corresponds to an AST

View File

@@ -26,9 +26,9 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/util"
"github.com/purpleidea/mgmt/util/errwrap"
multierr "github.com/hashicorp/go-multierror"
errwrap "github.com/pkg/errors"
)
const (

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -25,8 +25,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/util"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -23,8 +23,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
// RegisteredFuncs maps a function name to the corresponding static, pure func.

View File

@@ -23,8 +23,7 @@ import (
"github.com/purpleidea/mgmt/lang/funcs"
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
// RegisteredFuncs maps a function name to the corresponding static, pure funcs.

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
const (

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
// CompositeFunc is a function that passes through the value it receives. It is

View File

@@ -22,8 +22,7 @@ import (
"github.com/purpleidea/mgmt/lang/interfaces"
"github.com/purpleidea/mgmt/lang/types"
errwrap "github.com/pkg/errors"
"github.com/purpleidea/mgmt/util/errwrap"
)
// VarFunc is a function that passes through a function that came from a bind