Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a minor refinement of the code #174

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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