[racktables-users] bulk adding of Ports

  • From: Timothy Wolgemuth <tim-list@xxxxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Tue, 15 Jun 2010 10:08:11 -0400

I wanted to be able to customize where in the "Local name" and "Visible
label" the count appeared.  Below is a diff of the changes that I made.  You
just put ## where you want the count to appear.


diff interface-new.php interface-old.php
1144d1143
<               echo "NOTE: Place a ## where you want the count to be in the
Local name and Visible label<BR><BR>\n";




diff ophandlers-new.php ophandlers-old.php
378,379c378,379
<       //if(strrpos($port_name, "%u") === false )
<               //$port_name .= '%u';
---
>       if(strrpos($port_name, "%u") === false )
>               $port_name .= '%u';
382,385c382
<               $port_temp_name = str_replace("##", "$c", $port_name);
<               $port_temp_label = str_replace("##", "$c", $port_label);
<               // $result = commitAddPort ($object_id,
@sprintf($port_name,$c), $port_type_id, @sprintf($port_label,$c), '');
<               $result = commitAddPort ($object_id, $port_temp_name,
$port_type_id, $port_temp_label, '');
---
>               $result = commitAddPort ($object_id,
@sprintf($port_name,$c), $port_type_id, @sprintf($port_label,$c), '');



Tim Wolgemuth

Other related posts: