Skip to content

Commit

Permalink
a minor refinement of the code (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
skudriavtsev authored Jul 6, 2022
1 parent 2e8edbf commit 063667c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion object_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _ IBObjectManager = new(ObjectManager)
type IBObjectManager interface {
AllocateIP(netview string, cidr string, ipAddr string, isIPv6 bool, macOrDuid string, name string, comment string, eas EA) (*FixedAddress, error)
AllocateNetwork(netview string, cidr string, isIPv6 bool, prefixLen uint, comment string, eas EA) (network *Network, err error)
AllocateNetworkContainer(netview string, cidr string, isIPv6 bool, prefixLen uint, comment string, eas EA) (network *NetworkContainer, err error)
AllocateNetworkContainer(netview string, cidr string, isIPv6 bool, prefixLen uint, comment string, eas EA) (netContainer *NetworkContainer, err error)
CreateARecord(netView string, dnsView string, name string, cidr string, ipAddr string, ttl uint32, useTTL bool, comment string, ea EA) (*RecordA, error)
CreateAAAARecord(netView string, dnsView string, recordName string, cidr string, ipAddr string, useTtl bool, ttl uint32, comment string, eas EA) (*RecordAAAA, error)
CreateZoneAuth(fqdn string, ea EA) (*ZoneAuth, error)
Expand Down
15 changes: 6 additions & 9 deletions object_manager_network_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,22 @@ func (objMgr *ObjectManager) AllocateNetworkContainer(
isIPv6 bool,
prefixLen uint,
comment string,
eas EA) (networkContainer *NetworkContainer, err error) {
eas EA) (*NetworkContainer, error) {

containerInfo := NewNetworkContainerNextAvailableInfo(netview, cidr, prefixLen, isIPv6)
container := NewNetworkContainerNextAvailable(containerInfo, isIPv6, comment, eas)

ref, err := objMgr.connector.CreateObject(container)

if err == nil {
if isIPv6 {
networkContainer, err = BuildIPv6NetworkContainerFromRef(ref)
} else {
networkContainer, err = BuildNetworkContainerFromRef(ref)
}
}
if err != nil {
return nil, err
}

return
if isIPv6 {
return BuildIPv6NetworkContainerFromRef(ref)
} else {
return BuildNetworkContainerFromRef(ref)
}
}

func (objMgr *ObjectManager) DeleteNetworkContainer(ref string) (string, error) {
Expand Down

0 comments on commit 063667c

Please sign in to comment.