Skip to content

Commit b16bb89

Browse files
author
jojimt
committed
Merge pull request #396 from jojimt/rule
Fix cli arg checking to match the new model
2 parents b4739c8 + 3f3173d commit b16bb89

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

netctl/netctl.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ func createEndpointGroup(ctx *cli.Context) {
410410
}
411411

412412
func deleteEndpointGroup(ctx *cli.Context) {
413-
argCheck(2, ctx)
413+
argCheck(1, ctx)
414414

415415
tenant := ctx.String("tenant")
416416
group := ctx.Args()[0]
@@ -611,7 +611,7 @@ func showVersion(ctx *cli.Context) {
611611
}
612612

613613
func createAppProfile(ctx *cli.Context) {
614-
argCheck(2, ctx)
614+
argCheck(1, ctx)
615615

616616
tenant := ctx.String("tenant")
617617
prof := ctx.Args()[0]
@@ -629,7 +629,7 @@ func createAppProfile(ctx *cli.Context) {
629629
}
630630

631631
func updateAppProfile(ctx *cli.Context) {
632-
argCheck(2, ctx)
632+
argCheck(1, ctx)
633633

634634
tenant := ctx.String("tenant")
635635
prof := ctx.Args()[0]
@@ -647,7 +647,7 @@ func updateAppProfile(ctx *cli.Context) {
647647
}
648648

649649
func deleteAppProfile(ctx *cli.Context) {
650-
argCheck(2, ctx)
650+
argCheck(1, ctx)
651651

652652
tenant := ctx.String("tenant")
653653
prof := ctx.Args()[0]
@@ -705,7 +705,7 @@ func listAppProfiles(ctx *cli.Context) {
705705
}
706706

707707
func listAppProfEpgs(ctx *cli.Context) {
708-
argCheck(2, ctx)
708+
argCheck(1, ctx)
709709

710710
tenant := ctx.String("tenant")
711711
prof := ctx.Args()[0]

netmaster/objApi/apiController.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func (ac *APIController) AppProfileDelete(prof *contivModel.AppProfile) error {
303303
}
304304
}
305305

306-
modeldb.AddLinkSet(&tenant.LinkSets.AppProfiles, prof)
306+
modeldb.RemoveLinkSet(&tenant.LinkSets.AppProfiles, prof)
307307
tenant.Write()
308308
return nil
309309
}

0 commit comments

Comments
 (0)