Changeset 2102 for trunk/LATMOS-Accounts/lib
- Timestamp:
- 09/21/17 10:22:41 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm
r2101 r2102 692 692 my $desc = $self->_comment_nethost($obj); 693 693 foreach my $mac (sort grep { $_ } $obj->get_attributes('macaddr')) { 694 foreach my $retainip (@retainip) { 694 my %done; 695 foreach my $retainip (sort @retainip) { 695 696 $output .= $desc 696 697 ? '# ' . $desc . "\n" 697 698 : ''; 698 my $fixedparam = $retainip =~ /^\d+(\.\d+){3}$/ 699 ? '' 700 : '6'; 699 my ($fixedparam, $label) = $retainip =~ /^\d+(\.\d+){3}$/ 700 ? ('fixed-address', '') 701 : ('fixed-address6', '-6'); 702 # If two ip are given for same protocol keep only first 703 $done{$fixedparam} and next; 704 $done{$fixedparam} = 1; 701 705 my $fmac = $mac; 702 706 $fmac =~ s/://g; 703 $output .= sprintf("host %s $fixedparam-%s{\n", $nethost, lc($fmac));707 $output .= sprintf("host %s-%s$label {\n", $nethost, lc($fmac)); 704 708 $output .= sprintf(" hardware ethernet %s;\n", $mac); 705 709 $output .= sprintf(" fixed-address$fixedparam %s;\n", $retainip)
Note: See TracChangeset
for help on using the changeset viewer.