diff --git a/lib/App/Netdisco/Util/Port.pm b/lib/App/Netdisco/Util/Port.pm index 62b72f8e..383e893b 100644 --- a/lib/App/Netdisco/Util/Port.pm +++ b/lib/App/Netdisco/Util/Port.pm @@ -105,7 +105,8 @@ sub port_reconfig_check { # uplink check return "forbidden: port [$name] on [$ip] is an uplink" - if $port->remote_type and not $has_phone and not setting('portctl_uplinks'); + if ($port->is_uplink or $port->remote_type) + and not $has_phone and not setting('portctl_uplinks'); # phone check return "forbidden: port [$name] on [$ip] is a phone" @@ -215,18 +216,10 @@ sub is_vlan_interface { Returns true if the C<$port> L object has a phone connected. -This uses a simple check on the I of the remote connected device, and -therefore might sometimes return a false-negative result. - =cut sub port_has_phone { - my $port = shift; - - my $has_phone = ($port->remote_type - and $port->remote_type =~ /ip.phone/i) ? 1 : 0; - - return $has_phone; + return (shift)->with_properties->remote_is_phone; } 1;