@@ -54,7 +54,7 @@ function makeLabConfFile(netkit, lab) {
5454// TODO: Metti a fattor comune:
5555/*
5656 for (let machine of netkit) {
57- if (machine.name && machine.name != "" && .....
57+ if (machine.name && machine.name != "" && .....
5858*/
5959
6060function makeTerminal ( netkit , lab ) {
@@ -433,8 +433,7 @@ function makeBgpConf(router, lab) {
433433
434434 lab . file [ router . name + "/etc/zebra/bgpd.conf" ] += "\n" ;
435435
436- //Inserisco tutti i Neibourgh
437- for ( let remote in router . routing . bgp . remote ) {
436+ router . routing . bgp . remote . forEach ( function ( remote ) {
438437 if ( remote && remote . neighbor != "" && remote . as != "" ) {
439438 //Aggiungo il remote-as
440439 lab . file [ router . name + "/etc/zebra/bgpd.conf" ] += "neighbor " + remote . neighbor + " remote-as " + remote . as + "\n" ;
@@ -444,7 +443,8 @@ function makeBgpConf(router, lab) {
444443 lab . file [ router . name + "/etc/zebra/bgpd.conf" ] += "neighbor " + remote . neighbor + " description " + remote . description + "\n" ;
445444 }
446445 }
447- }
446+ } ) ;
447+
448448 //Free conf
449449 if ( router . routing . bgp . free && router . routing . bgp . free != "" )
450450 lab . file [ router . name + "/etc/zebra/bgpd.conf" ] += "\n" + router . routing . bgp . free + "\n" ;
@@ -457,10 +457,10 @@ function makeFilesStructure(netkit, labInfo) {
457457 let isAllValidNames = netkit
458458 . map ( machine => machine . name && / [ A - z 0 - 9 ] + / i. test ( machine . name ) )
459459 . reduce ( ( prev , curr , ind ) => ind == 0 ? curr : ( prev && curr ) ) // Tutti i nomi devono aver soddisfatto la regex
460- if ( ! isAllValidNames )
460+ if ( ! isAllValidNames )
461461 return { folders : [ ] , file : [ ] }
462462
463- var lab = [ ] ; // TODO: E' un oggetto... Cosa c'entra un array?! sistemare (se ho tempo di ricontrollare bene tutto)
463+ var lab = { } ;
464464 lab . folders = [ ] ;
465465 lab . file = [ ] ;
466466 lab . warning = 0 ;
0 commit comments