summaryrefslogtreecommitdiff
path: root/create.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-30 12:30:34 -0500
committerJeff Carr <[email protected]>2024-10-30 12:30:34 -0500
commit2a18f506c7e37903e58b838e52b6b6554e7e039c (patch)
tree074fca97694ef9fc76acc2218be874d625560e31 /create.go
parent410015c33e7d905ee03fab29d24961aab9df093f (diff)
simple unique mac
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'create.go')
-rw-r--r--create.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/create.go b/create.go
index 3b6de72..f97a575 100644
--- a/create.go
+++ b/create.go
@@ -38,19 +38,16 @@ func create(w http.ResponseWriter, r *http.Request) error {
fmt.Fprintln(w, result)
return errors.New(result)
}
+
if d.Uuid == "" {
u := uuid.New()
d.Uuid = u.String()
}
- return nil
+
if len(d.Networks) == 0 {
- mac, err := getNewMac()
- if err != nil {
- return err
- }
var newNet *pb.Network
newNet = new(pb.Network)
- newNet.Mac = mac
+ newNet.Mac = getNewMac()
d.Networks = append(d.Networks, newNet)
// d.AddDefaultNetwork(mac)
}