use netParseIP and ParseMAC
check also MAC addresses and common formating Signed-off-by: Christian Goll <cgoll@suse.de> reformat ipaddr for test coverage fixed processing of default values updated transformer tests correct behavior for tags add tests for tags new tests for primary network Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
<<<<<<< HEAD
|
||||
/*
|
||||
RunE needs a function of type func(*cobraCommand,[]string) err, but
|
||||
in order to avoid global variables which mess up testing a function of
|
||||
@@ -17,10 +16,12 @@ the required type is returned
|
||||
*/
|
||||
func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) error {
|
||||
return func(cmd *cobra.Command, args []string) error {
|
||||
// run converters for different types
|
||||
for _, c := range Converters {
|
||||
c()
|
||||
}
|
||||
// run converters for different types
|
||||
for _, c := range vars.converters {
|
||||
if err := c(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// remove the default network as all network values are assigned
|
||||
// to this network
|
||||
if _, ok := vars.nodeConf.NetDevs["default"]; ok && vars.netName != "" {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
type variables struct {
|
||||
netName string
|
||||
nodeConf node.NodeConf
|
||||
converters []func()
|
||||
converters []func() error
|
||||
}
|
||||
|
||||
// Returns the newly created command
|
||||
|
||||
@@ -15,7 +15,9 @@ import (
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
// run converters for different types
|
||||
for _, c := range Converters {
|
||||
c()
|
||||
if err := c(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// remove the default network as the all network values are assigned
|
||||
// to this network
|
||||
|
||||
@@ -38,7 +38,7 @@ var (
|
||||
SetYes bool
|
||||
SetForce bool
|
||||
NodeConf node.NodeConf
|
||||
Converters []func()
|
||||
Converters []func() error
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -16,7 +16,9 @@ import (
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
// run converters for different types
|
||||
for _, c := range Converters {
|
||||
c()
|
||||
if err := c(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// remove the default network as the all network values are assigned
|
||||
// to this network
|
||||
|
||||
@@ -25,7 +25,7 @@ var (
|
||||
SetForce bool
|
||||
NetName string
|
||||
ProfileConf node.NodeConf
|
||||
Converters []func()
|
||||
Converters []func() error
|
||||
)
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
@@ -38,7 +38,7 @@ var (
|
||||
SetForce bool
|
||||
NetName string
|
||||
ProfileConf node.NodeConf
|
||||
Converters []func()
|
||||
Converters []func() error
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user