$self->SUPER::check;
}
+#false laziness w/svc_cable
+sub _check_duplicate {
+ my $self = shift;
+
+ # Not reliable checks because the table isn't locked, but that's why we have
+ # unique indices. These are just to give friendlier error messages.
+
+ if ( $self->hw_addr ) {
+ my @dup_mac;
+ @dup_mac = $self->find_duplicates('global', 'hw_addr');
+ if ( @dup_mac ) {
+ return "Hardware address in use (svcnum ".$dup_mac[0]->svcnum.")";
+ }
+ }
+
+ if ( $self->ip_addr ) {
+ my @dup_ip;
+ @dup_ip = $self->find_duplicates('global', 'ip_addr');
+ if ( @dup_ip ) {
+ return "IP address in use (svcnum ".$dup_ip[0]->svcnum.")";
+ }
+ }
+
+ if ( $self->serial ) {
+ my @dup_serial;
+ @dup_serial = $self->find_duplicates('global', 'typenum', 'serial');
+ if ( @dup_serial ) {
+ return "Serial number in use (svcnum ".$dup_serial[0]->svcnum.")";
+ }
+ }
+
+ '';
+}
+
=item hardware_type
Returns the L<FS::hardware_type> object associated with this installation.
join(':', $self->hw_addr =~ /../g) : $self->hw_addr)
}
+sub _upgrade_data {
+
+ require FS::Misc::FixIPFormat;
+ FS::Misc::FixIPFormat::fix_bad_addresses_in_table(
+ 'svc_hardware', 'svcnum', 'ip_addr',
+ );
+
+ '';
+
+}
+
=back
=head1 SEE ALSO
=cut
1;
-