f-37: code: add state error in return nil #37
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
3edc319969
commit
fa72b6cd47
4 changed files with 18 additions and 0 deletions
|
|
@ -22,6 +22,8 @@ type CreateSubnetCommand struct {
|
|||
DefaultRoute bool
|
||||
}
|
||||
|
||||
func (c CreateSubnetCommand) Key() string { return "subnet/" + c.Name }
|
||||
|
||||
func (c CreateSubnetCommand) Prepare(db *badger.DB, cfg *configuration.Config) error {
|
||||
if c.Mode == "" {
|
||||
c.Mode = "vxlan"
|
||||
|
|
@ -79,6 +81,8 @@ type DeleteSubnetCommand struct {
|
|||
Name string
|
||||
}
|
||||
|
||||
func (c DeleteSubnetCommand) Key() string { return "subnet/" + c.Name }
|
||||
|
||||
func (c DeleteSubnetCommand) Prepare(db *badger.DB, _ *configuration.Config) error {
|
||||
if _, err := kv.GetFromDB(db, "subnet/"+c.Name+"/state"); err != nil {
|
||||
return fmt.Errorf("subnet %q not found", c.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue