opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
137 stars 35 forks source link

BUG: dcp.pl -r subnet_add #49

Closed dongreer closed 11 years ago

dongreer commented 11 years ago

After creating a vlan "X" on campus "Foo" with subnet "10.1.2.0/24", then adding vlan "X" on campus "Bar" with subnet "10.2.2.0/24" failes with "ERROR => The vlan/campus pair specified is invalid!"

I can do exactly the same creation through the GUI. I've not dug into the code, but I strongly suspect that dcm.php or something is doing a check to make sure that the VLAN is not a duplicate, rather than the VLAN/Campus is not a duplicate. I'll go digging for this and if I find something, I'll update where it is.

dongreer commented 11 years ago

The issue is that the return array from the ona_get_vlan_campus_record is being reference with "ID", but the key being returned is "id". Here's the diff for the fix.

--- /opt/ona-20130610/www/include/functions_db.inc.php 2013-03-05 09:46:23.000000000 -0600 +++ /opt/ona/www/include/functions_db.inc.php 2013-06-10 11:46:58.941521441 -0500 @@ -2497,7 +2497,7 @@

 // Search for a vlan by NAME, use the campus[ID] if we have one
 $where = array('NAME' => $vlan_search);
nicsaravanan commented 8 years ago

Hi,

We are also getting the same error, we tried to modify the functions_db.in.php as described above but not working

./dcm.pl -r subnet_add name=TESTSSH1 ip=192.168.103.16 netmask=255.255.255.248 type=VLAN campus=TEST-VLAN-CAMPUS vlan=3002

ERROR => The vlan/campus pair specified is invalid!