Skip to content
Snippets Groups Projects
Commit 480ae87c authored by André Sterba's avatar André Sterba
Browse files

Load exisiting base pnd uuid

parent 822e56dd
No related branches found
No related tags found
1 merge request!170DRAFT: Persist added devices
Pipeline #80966 failed
...@@ -92,7 +92,20 @@ func createSouthboundInterfaces() error { ...@@ -92,7 +92,20 @@ func createSouthboundInterfaces() error {
// createPrincipalNetworkDomain initializes the controller with an initial PND // createPrincipalNetworkDomain initializes the controller with an initial PND
func createPrincipalNetworkDomain(s southbound.SouthboundInterface) error { func createPrincipalNetworkDomain(s southbound.SouthboundInterface) error {
pnd, err := nucleus.NewPND("base", "gosdn base pnd", uuid.New(), s) var pndUUID uuid.UUID
// Check if there is already an PND.
pndUUIDAsString := viper.GetString("pnd")
if pndUUIDAsString == "" {
pndUUID = uuid.New()
}
pndUUID, err := uuid.Parse(pndUUIDAsString)
if err != nil {
return err
}
pnd, err := nucleus.NewPND("base", "gosdn base pnd", pndUUID, s)
if err != nil { if err != nil {
return err return err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment