Changeset 1318 for trunk/LATMOS-Accounts/bin/la-sql-switch-cname
- Timestamp:
- 04/07/15 16:42:41 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/bin/la-sql-switch-cname
r1280 r1318 52 52 pod2usage(1); 53 53 } 54 54 55 55 my ($to, $from) = ($ARGV[-1], $ARGV[-2]); 56 56 … … 72 72 warn "CNAME $cname: $nhost => $to\n"; 73 73 74 { 75 my @name = grep { $_ && $_ ne $cname } $onhost->get_attributes('cname'); 76 $onhost->set_c_fields(cname => @name ? [ @name ] : undef) or die "Cannot set $cname to $nhost\n"; 77 } 78 79 { 80 my @name = $cname, $oto->get_attributes('cname'); 81 $oto->set_c_fields(cname => [ grep { $_ } @name ]) or die "Cannot add $cname to $to\n"; 82 } 74 $onhost->delAttributeValue('cname', $cname) or die "Cannot remove $cname from $nhost\n"; 75 $oto->addAttributeValue ('cname', $cname) or die "Cannot add $cname to $to\n"; 83 76 } 77 84 78 foreach my $aname (@arecords) { 85 79 my @listhost = $labase->search_objects('nethost', "otherName=$aname"); … … 97 91 warn "CNAME $aname: $nhost => $to"; 98 92 99 { 100 my @name = grep { $_ && $_ ne $aname } $onhost->get_attributes('otherName'); 101 $onhost->set_c_fields(otherName => @name ? [ @name ] : undef) or die "Cannot set $aname to $nhost\n"; 102 } 103 104 { 105 my @name = $aname, $oto->get_attributes('otherName'); 106 $oto->set_c_fields(otherName => [ grep { $_ } @name ]) or die "Cannot add $aname to $to\n"; 107 } 93 $onhost->delAttributeValue('otherName', $aname) or die "Cannot remove $aname from $nhost\n"; 94 $oto->addAttributeValue ('otherName', $aname) or die "Cannot add $aname to $to\n"; 108 95 } 109 96
Note: See TracChangeset
for help on using the changeset viewer.