f-21: fix: use of exit become return
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
648a64782c
commit
fe6792be0d
1 changed files with 6 additions and 7 deletions
|
|
@ -2,7 +2,6 @@ package dispatcher
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -77,13 +76,13 @@ func (c DeleteSubnetCommand) Prepare(db *badger.DB, _ *configuration.Config) err
|
||||||
|
|
||||||
func (c DeleteSubnetCommand) Execute(db *badger.DB, _ *configuration.Config) error {
|
func (c DeleteSubnetCommand) Execute(db *badger.DB, _ *configuration.Config) error {
|
||||||
if err := subnet.DeleteSubnet(db, c.Name); err != nil {
|
if err := subnet.DeleteSubnet(db, c.Name); err != nil {
|
||||||
fmt.Println(err)
|
return err
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
if state, err := kv.GetFromDB(db, "subnet/"+c.Name+"/state"); err != nil {
|
state, err := kv.GetFromDB(db, "subnet/"+c.Name+"/state")
|
||||||
fmt.Println(err)
|
if err != nil {
|
||||||
os.Exit(1)
|
return err
|
||||||
} else if state == "deleted" {
|
}
|
||||||
|
if state == "deleted" {
|
||||||
kv.DeleteInDB(db, "subnet/"+c.Name)
|
kv.DeleteInDB(db, "subnet/"+c.Name)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue