update various commands to adapt the new Factory interface

This commit is contained in:
AdoHe
2016-10-13 08:18:39 +08:00
parent dfae1a27c2
commit b2280a646a
53 changed files with 154 additions and 200 deletions

View File

@@ -69,7 +69,7 @@ func TestCordon(t *testing.T) {
description string
node *api.Node
expected *api.Node
cmd func(*cmdutil.Factory, io.Writer) *cobra.Command
cmd func(cmdutil.Factory, io.Writer) *cobra.Command
arg string
expectFatal bool
}{
@@ -177,7 +177,10 @@ func TestCordon(t *testing.T) {
// Restore cmdutil behavior
cmdutil.DefaultBehaviorOnFatal()
}()
cmdutil.BehaviorOnFatal(func(e string, code int) { saw_fatal = true; panic(e) })
cmdutil.BehaviorOnFatal(func(e string, code int) {
saw_fatal = true
panic(e)
})
cmd.SetArgs([]string{test.arg})
cmd.Execute()
}()