Skip to content
Open
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
23 changes: 20 additions & 3 deletions lib/Netdot/Model/DhcpScope.pm
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,25 @@ sub _print {
unless ( $type = $data->{$id}->{type} ){
$class->throw_fatal("Scope id $id missing type");
}

if ( $type ne 'global' && $type ne 'template' ){
# generate subnet scope name and directive
if ( $type eq 'subnet'){
my $name = $data->{$id}->{name};
my $ipblock = DhcpScope->retrieve($id)->ipblock;
my $netaddr = $ipblock->full_address;
my $mask = $ipblock->netaddr->mask;
print $fh "# $name\n";
print $fh "subnet $netaddr netmask $mask {\n";
$indent .= " " x 4;
}
# pring global scope group
elsif ( $type eq 'global'){
my $name = $data->{$id}->{name};
print $fh $indent."#$name\n";
print $fh $indent."group {\n";
$indent .= " " x 4;
}
# print scope name
elsif ( $type ne 'template' ){
my $st = $data->{$id}->{statement};
my $name = $data->{$id}->{name};
print $fh $indent."$st $name {\n";
Expand Down Expand Up @@ -815,7 +832,7 @@ sub _print {
}

# Close scope definition
if ( $type ne 'global' && $type ne 'template' ){
if ( $type ne 'template' ){
$indent = $pindent;
print $fh $indent."}\n";
}
Expand Down