@@ -50,8 +50,8 @@ export default class {
50
50
this . _log (
51
51
`Failed to add ${ node . type } /${ node . hostname } : conflicting hostname.` ,
52
52
"error" ,
53
- node
54
- )
53
+ node ,
54
+ ) ,
55
55
) ;
56
56
} else if (
57
57
error instanceof SyntaxError &&
@@ -62,8 +62,8 @@ export default class {
62
62
this . _log (
63
63
`Failed to add ${ port . type } /${ port . hostname } : conflicting interface name ${ devname } .` ,
64
64
"error" ,
65
- port
66
- )
65
+ port ,
66
+ ) ,
67
67
) ;
68
68
} else if (
69
69
error instanceof SyntaxError &&
@@ -73,7 +73,7 @@ export default class {
73
73
this . _log (
74
74
`Failed to add ${ port . type } /${ port . hostname } : single port has multiple links.` ,
75
75
"error" ,
76
- port
76
+ port ,
77
77
) ;
78
78
} else if (
79
79
error instanceof SyntaxError &&
@@ -83,18 +83,18 @@ export default class {
83
83
this . _log (
84
84
`Failed to add ${ port . type } /${ port . hostname } : port can't be both physical and connected to a link.` ,
85
85
"error" ,
86
- port
86
+ port ,
87
87
) ;
88
88
} else {
89
89
console . error ( error ) ;
90
90
this . _log (
91
91
item != null && item . type !== null && item . id !== null
92
92
? `Failed to add ${ item . type } /${ item . hostname } .`
93
93
: `Malformed item (${ this . _items . arr . $all . find (
94
- ( v ) => v === item
94
+ ( v ) => v === item ,
95
95
) } ).`,
96
96
"error" ,
97
- item
97
+ item ,
98
98
) ;
99
99
}
100
100
@@ -106,19 +106,19 @@ export default class {
106
106
// Log level
107
107
if ( this . _data . logLevel ) {
108
108
this . _code . preInit . push (
109
- `mininet.log.setLogLevel('${ this . _data . logLevel } ')`
109
+ `mininet.log.setLogLevel('${ this . _data . logLevel } ')` ,
110
110
) ;
111
111
}
112
112
113
113
// Scripts
114
114
if ( this . _data . startScript ) {
115
115
this . _code . globalStartCmds . push (
116
- ...this . _scriptToCmds ( this . _data . startScript )
116
+ ...this . _scriptToCmds ( this . _data . startScript ) ,
117
117
) ;
118
118
}
119
119
if ( this . _data . stopScript ) {
120
120
this . _code . globalStopCmds . push (
121
- ...this . _scriptToCmds ( this . _data . stopScript )
121
+ ...this . _scriptToCmds ( this . _data . stopScript ) ,
122
122
) ;
123
123
}
124
124
@@ -156,7 +156,7 @@ export default class {
156
156
Boolean ,
157
157
"xterms" ,
158
158
] ,
159
- ] )
159
+ ] ) ,
160
160
) ;
161
161
162
162
return this . _code . toString ( ) ;
@@ -178,7 +178,7 @@ export default class {
178
178
[ controller . protocol != null , controller . protocol , String , "protocol" ] ,
179
179
] ) ;
180
180
this . _code . nodes . push (
181
- `${ controller . hostname } = net.addController(${ args . join ( ", " ) } )`
181
+ `${ controller . hostname } = net.addController(${ args . join ( ", " ) } )` ,
182
182
) ;
183
183
this . _code . startControllers . push ( `${ controller . hostname } .start()` ) ;
184
184
}
@@ -197,7 +197,7 @@ export default class {
197
197
] ,
198
198
[
199
199
[ host . cpuScheduler , host . cpuCores , host . cpuLimit ] . some (
200
- ( v ) => v != null
200
+ ( v ) => v != null ,
201
201
) ,
202
202
"mininet.node.CPULimitedHost" ,
203
203
null ,
@@ -212,15 +212,15 @@ export default class {
212
212
[ host . cpuLimit != null , host . cpuLimit , Number , "f" ] ,
213
213
] ) ;
214
214
this . _code . nodeLimits . push (
215
- `${ host . hostname } .setCPUFrac(${ args . join ( ", " ) } )`
215
+ `${ host . hostname } .setCPUFrac(${ args . join ( ", " ) } )` ,
216
216
) ;
217
217
}
218
218
if ( host . cpuCores != null ) {
219
219
const args = pyArgs ( [
220
220
[ host . cpuCores != null , host . cpuCores . join ( "," ) , String , "cores" ] ,
221
221
] ) ;
222
222
this . _code . nodeLimits . push (
223
- `${ host . hostname } .setCPUs(${ args . join ( ", " ) } )`
223
+ `${ host . hostname } .setCPUs(${ args . join ( ", " ) } )` ,
224
224
) ;
225
225
}
226
226
@@ -241,16 +241,16 @@ export default class {
241
241
this . _log (
242
242
`Failed to add ${ link . type } /${ link . hostname } : link can't be connected to disconnected port(s).` ,
243
243
"warning" ,
244
- link
244
+ link ,
245
245
) ;
246
246
[ ...( fromNode ? [ ] : [ fromPort ] ) , ...( toNode ? [ ] : [ toPort ] ) ] . forEach (
247
247
( port ) => {
248
248
this . _log (
249
249
`Failed to add ${ port . type } /${ port . hostname } : port can't be connected to a link but not to a node.` ,
250
250
"warning" ,
251
- port
251
+ port ,
252
252
) ;
253
- }
253
+ } ,
254
254
) ;
255
255
256
256
return ;
@@ -280,7 +280,7 @@ export default class {
280
280
this . _log (
281
281
`Skipping ${ port . type } /${ port . hostname } : not connected to any node.` ,
282
282
"info" ,
283
- port
283
+ port ,
284
284
) ;
285
285
return ;
286
286
}
@@ -289,7 +289,7 @@ export default class {
289
289
this . _log (
290
290
`Skipping ${ port . type } /${ port . hostname } : port has to be either physical or connected to a link.` ,
291
291
"info" ,
292
- port
292
+ port ,
293
293
) ;
294
294
return ;
295
295
}
@@ -321,7 +321,7 @@ export default class {
321
321
`${ node . hostname } .intf('${ dev } ').prefixLen = ${ ip . split ( "/" ) [ 1 ] } ` ,
322
322
]
323
323
: [ ] ) ,
324
- `${ node . hostname } .cmd('ip a a ${ ip } dev ${ dev } ')`
324
+ `${ node . hostname } .cmd('ip a a ${ ip } dev ${ dev } ')` ,
325
325
) ;
326
326
} ) ;
327
327
}
@@ -354,13 +354,13 @@ export default class {
354
354
[ swtch . verbose != null , swtch . verbose , Boolean , "verbose" ] ,
355
355
] ) ;
356
356
const controllerHostnames = this . _getNeighbors ( swtch , [ "controller" ] ) . map (
357
- ( controller ) => controller . hostname
357
+ ( controller ) => controller . hostname ,
358
358
) ;
359
359
this . _code . nodes . push (
360
- `${ swtch . hostname } = net.addSwitch(${ args . join ( ", " ) } )`
360
+ `${ swtch . hostname } = net.addSwitch(${ args . join ( ", " ) } )` ,
361
361
) ;
362
362
this . _code . startSwitches . push (
363
- `${ swtch . hostname } .start([${ controllerHostnames . join ( ", " ) } ])`
363
+ `${ swtch . hostname } .start([${ controllerHostnames . join ( ", " ) } ])` ,
364
364
) ;
365
365
366
366
this . _addNodeScripts ( swtch . hostname , swtch . startScript , swtch . stopScript ) ;
@@ -425,7 +425,7 @@ export default class {
425
425
_addNodeScripts ( hostname , startScript , stopScript ) {
426
426
if ( startScript ) {
427
427
this . _code . nodeStartCmds . push (
428
- ...this . _scriptToCmds ( startScript , hostname )
428
+ ...this . _scriptToCmds ( startScript , hostname ) ,
429
429
) ;
430
430
}
431
431
if ( stopScript ) {
0 commit comments