Skip to content

Commit 95a0e6d

Browse files
committed
update version ref and fixes for pylint
1 parent b1f5085 commit 95a0e6d

22 files changed

+168
-130
lines changed

.pylint

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#init-hook=
1717

1818
# Profiled execution.
19-
profile=no
19+
#profile=no
2020

2121
# Add <file or directory> to the black list. It should be a base name, not a
2222
# path. You may set this option multiple times.
@@ -54,7 +54,7 @@ output-format=colorized
5454
msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
5555

5656
# Include message's id in output
57-
include-ids=yes
57+
#include-ids=yes
5858

5959
# Put messages in a separate file for each module / package specified on the
6060
# command line instead of printing them on stdout. Reports (if any) will be
@@ -73,7 +73,7 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme
7373

7474
# Add a comment according to your evaluation note. This is used by the global
7575
# evaluation report (R0004).
76-
comment=no
76+
#comment=no
7777

7878
# Enable the report(s) with the given id(s).
7979
#enable-report=
@@ -95,7 +95,7 @@ comment=no
9595
[BASIC]
9696

9797
# Required attributes for module, separated by a comma
98-
required-attributes=
98+
#required-attributes=
9999

100100
# Regular expression which should only match functions or classes name which do
101101
# not require a docstring
@@ -153,7 +153,7 @@ ignored-classes=SQLObjec
153153

154154
# When zope mode is activated, add a predefined set of Zope acquired attributes
155155
# to generated-members.
156-
zope=no
156+
#zope=no
157157

158158
# List of members which are set dynamically and missed by pylint inference
159159
# system, and so shouldn't trigger E0201 when accessed.
@@ -191,7 +191,7 @@ additional-builtins=
191191

192192
# List of interface methods to ignore, separated by a comma. This is used for
193193
# instance to not check methods defines in Zope's Interface base class.
194-
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
194+
#ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
195195

196196
# List of method names used to declare (i.e. assign) instance attributes.
197197
defining-attr-methods=__init__,__new__,setUp,build

INSTALL

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Mininet-WiFi Installation/Configuration Notes
33
----------------------------------------
44

5-
Mininet-WiFi 2.2.0d1
5+
Mininet-WiFi 2.2.1d1
66
---
77

88
The supported installation methods for Mininet are 1) using a

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mininet-WiFi 2.2.0d1 License
1+
Mininet-WiFi 2.2.1d1 License
22

33
Copyright (c) 2013-2016 Open Networking Laboratory
44
Copyright (c) 2009-2012 Bob Lantz and The Board of Trustees of

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
MININET = mininet/*.py
2+
MININET_WIFI = mininet/wifi/*.py
23
TEST = mininet/test/*.py
34
EXAMPLES = mininet/examples/*.py
45
MN = bin/mn
56
PYMN = python -B bin/mn
67
BIN = $(MN)
7-
PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
8+
PYSRC = $(MININET) $(MININET_WIFI) $(TEST) $(EXAMPLES) $(BIN)
89
MNEXEC = mnexec
910
MANPAGES = mn.1 mnexec.1
1011
P8IGN = E251,E201,E302,E202,E126,E127,E203,E226

bin/mn

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
"""
44
Mininet runner
5-
author: Brandon Heller ([email protected]) - (Modified by Ramon Fontes ([email protected])
5+
author: Brandon Heller ([email protected]) -
6+
Modified by: Ramon Fontes ([email protected])
67
78
To see options:
89
sudo mn -h
@@ -35,13 +36,15 @@ from mininet.node import (Host, CPULimitedHost, Controller, OVSController,
3536
from mininet.nodelib import LinuxBridge
3637
from mininet.link import Link, TCLink, TCULink, OVSLink
3738

38-
from mininet.topo import (SingleSwitchTopo, LinearTopo, SingleSwitchReversedTopo,
39+
from mininet.topo import (SingleSwitchTopo, LinearTopo,
40+
SingleSwitchReversedTopo,
3941
MinimalTopo)
4042
from mininet.topolib import TreeTopo, TorusTopo
4143
from mininet.util import customClass, specialClass, splitArgs
4244
from mininet.util import buildTopo
4345

44-
from mininet.wifi.topo import (SingleAPTopo, LinearWirelessTopo, MinimalWirelessTopo)
46+
from mininet.wifi.topo import (SingleAPTopo, LinearWirelessTopo,
47+
MinimalWirelessTopo)
4548
from mininet.wifi.link import TCWirelessLink, wmediumd
4649
from mininet.wifi.node import UserAP, OVSAP
4750

@@ -207,7 +210,8 @@ class MininetRunner(object):
207210
for fileName in files:
208211
customs = {}
209212
if os.path.isfile(fileName):
210-
exec (compile(open(fileName, "rb").read(), fileName, 'exec'), customs, customs)
213+
exec (compile(open(fileName, "rb").read(), fileName, 'exec'),
214+
customs, customs)
211215
if py_version_info < (3, 0):
212216
custom_items = customs.iteritems()
213217
else:
@@ -459,7 +463,8 @@ class MininetRunner(object):
459463
if opts.cluster:
460464
warn('*** WARNING: Experimental cluster mode!\n'
461465
'*** Using RemoteHost, RemoteOVSSwitch, RemoteLink\n')
462-
host, switch, ap, link = RemoteHost, RemoteOVSSwitch, RemoteOVSAP, RemoteLink
466+
host, switch, ap, link = RemoteHost, RemoteOVSSwitch, \
467+
RemoteOVSAP, RemoteLink
463468
Net = partial(MininetCluster, servers=servers,
464469
placement=PLACEMENT[opts.placement])
465470
mininet.wifi.cli.CLI_wifi = ClusterCLI

examples/active_scan.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ def topology():
1414
net = Mininet_wifi(controller=Controller, accessPoint=UserAP)
1515

1616
info("*** Creating nodes\n")
17-
net.addStation('sta1', passwd='123456789a,123456789a', encrypt='wpa2,wpa2', wlans=2,
18-
active_scan=1, scan_freq='2412,2437', freq_list='2412,2437',
19-
position='5,10,0')
17+
net.addStation('sta1', passwd='123456789a,123456789a', encrypt='wpa2,wpa2',
18+
wlans=2, active_scan=1, scan_freq='2412,2437',
19+
freq_list='2412,2437', position='5,10,0')
2020
net.addStation('sta2', passwd='123456789a', encrypt='wpa2',
2121
active_scan=1, scan_freq='2437', freq_list='2437',
2222
position='45,10,0')
2323
ap1 = net.addAccessPoint('ap1', ssid="ssid-1", mode="g", channel="1",
24-
passwd='123456789a', encrypt='wpa2', position='10,10,0')
24+
passwd='123456789a', encrypt='wpa2',
25+
position='10,10,0')
2526
ap2 = net.addAccessPoint('ap2', ssid="ssid-1", mode="g", channel="6",
26-
passwd='123456789a', encrypt='wpa2', position='40,10,0')
27-
c0 = net.addController('c0', controller=Controller, ip='127.0.0.1', port=6633)
27+
passwd='123456789a', encrypt='wpa2',
28+
position='40,10,0')
29+
c0 = net.addController('c0', controller=Controller, ip='127.0.0.1',
30+
port=6633)
2831

2932
info("*** Configuring wifi nodes\n")
3033
net.configureWifiNodes()

examples/authentication.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def topology():
1818
sta2 = net.addStation('sta2', passwd='123456789a', encrypt='wpa2')
1919
ap1 = net.addAccessPoint('ap1', ssid="simplewifi", mode="g", channel="1",
2020
passwd='123456789a', encrypt='wpa2')
21-
c0 = net.addController('c0', controller=Controller, ip='127.0.0.1', port=6633)
21+
c0 = net.addController('c0', controller=Controller, ip='127.0.0.1',
22+
port=6633)
2223

2324
info("*** Configuring wifi nodes\n")
2425
net.configureWifiNodes()

examples/capwap-wtp.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
"""Enabling CAPWAP_WTP
44
Please consider to follow up this repository:
5-
https://github.com/ramonfontes/opencapwap-mininet-wifi
6-
"""
5+
https://github.com/ramonfontes/opencapwap-mininet-wifi """
76

87
from mininet.node import Controller
98
from mininet.log import setLogLevel, info

examples/simplewifitopology.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ def topology(isVirtual):
2222
sta1 = net.addStation('sta1')
2323
sta2 = net.addStation('sta2')
2424
if isVirtual:
25-
ap1 = net.addAccessPoint('ap1', ssid="simplewifi", mode="g", channel="5")
25+
ap1 = net.addAccessPoint('ap1', ssid="simplewifi",
26+
mode="g", channel="5")
2627
else:
2728
# isolate_clientes: Client isolation can be used to prevent low-level
2829
# bridging of frames between associated stations in the BSS.
2930
# By default, this bridging is allowed.
3031
# OpenFlow rules are required to allow communication among nodes
31-
ap1 = net.addAccessPoint('ap1', ssid="simplewifi", isolate_clientes=True,
32-
mode="g", channel="5")
32+
ap1 = net.addAccessPoint('ap1', ssid="simplewifi",
33+
isolate_clientes=True, mode="g", channel="5")
3334
c0 = net.addController('c0', controller=Controller, ip='127.0.0.1',
3435
port=6633)
3536

examples/sumo-experimental.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def topology():
116116
j = 1
117117
for carsta2 in net.carsSTA:
118118
if carsta1 != carsta2:
119-
carsta1.cmd('route add -host 192.168.1.%s gw 10.0.0.%s' % (j, i))
119+
carsta1.cmd('route add -host 192.168.1.%s '
120+
'gw 10.0.0.%s' % (j, i))
120121
i += 1
121122
j += 2
122123

mininet/clean.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ def addCleanupCallback( cls, callback ):
134134

135135

136136
cleanup = Cleanup.cleanup
137-
addCleanupCallback = Cleanup.addCleanupCallback
137+
addCleanupCallback = Cleanup.addCleanupCallback

mininet/net.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ class Mininet(object):
113113
"Network emulation with hosts spawned in network namespaces."
114114

115115
def __init__(self, topo=None, switch=OVSKernelSwitch, host=Host,
116-
controller=DefaultController, link=Link, intf=Intf,
117-
build=True, xterms=False, cleanup=False, ipBase='10.0.0.0/8',
118-
inNamespace=False,
119-
autoSetMacs=False, autoStaticArp=False, autoPinCpus=False,
120-
listenPort=None, waitConnected=False):
116+
controller=DefaultController, link=Link, intf=Intf,
117+
build=True, xterms=False, cleanup=False, ipBase='10.0.0.0/8',
118+
inNamespace=False, autoSetMacs=False, autoStaticArp=False,
119+
autoPinCpus=False, listenPort=None, waitConnected=False):
121120
"""Create Mininet object.
122121
topo: Topo (topology) object or None
123122
switch: default Switch class
@@ -863,13 +862,13 @@ def runCpuLimitTest(self, cpu, duration=5):
863862
for host in hosts:
864863
outputs[host] = []
865864
with open('/sys/fs/cgroup/cpuacct/%s/cpuacct.usage' %
866-
host, 'r') as f:
865+
host, 'r') as f:
867866
time[host] = float(f.read())
868867
for _ in range(duration):
869868
sleep(1)
870869
for host in hosts:
871870
with open('/sys/fs/cgroup/cpuacct/%s/cpuacct.usage' %
872-
host, 'r') as f:
871+
host, 'r') as f:
873872
readTime = float(f.read())
874873
outputs[host].append(((readTime - time[host])
875874
/ 1000000000) / cores * 100)

mininet/node.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
from sys import version_info as py_version_info
6161
from subprocess import Popen, PIPE
6262
from time import sleep
63+
from distutils.version import StrictVersion
64+
from re import findall
6365
from six import string_types
6466

6567
from mininet.log import info, error, warn, debug
@@ -68,8 +70,6 @@
6870
from mininet.utils.private_folder_manager import PrivateFolderManager
6971
from mininet.moduledeps import moduleDeps, pathCheck, TUN
7072
from mininet.link import Link, Intf, TCIntf, OVSIntf
71-
from re import findall
72-
from distutils.version import StrictVersion
7373

7474

7575
class Node( object ):
@@ -108,7 +108,8 @@ def __init__( self, name, inNamespace=True, **params ):
108108

109109
# Start command interpreter shell
110110
self.startShell()
111-
self.private_folder_manager = PrivateFolderManager(self, params.get('privateDirs', []))
111+
self.private_folder_manager = \
112+
PrivateFolderManager(self, params.get('privateDirs', []))
112113

113114
# File descriptor to node mapping support
114115
# Class variables and methods

mininet/test/test_hifi.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from functools import partial
99

1010
from mininet.net import Mininet
11-
from mininet.node import OVSSwitch, UserSwitch, IVSSwitch
11+
from mininet.node import IVSSwitch
12+
from mininet.wifi.node import OVSAP, UserAP
1213
from mininet.node import CPULimitedHost
1314
from mininet.link import TCLink
1415
from mininet.topo import Topo
@@ -19,7 +20,7 @@
1920
# Number of stations for each test
2021
N = 2
2122

22-
class SingleSwitchOptionsTopo(Topo):
23+
class SingleAPOptionsTopo(Topo):
2324
"Single switch connected to n hosts."
2425
def __init__(self, n=2, hopts=None, lopts=None):
2526
if not hopts:
@@ -39,7 +40,7 @@ class testOptionsTopoCommon( object ):
3940
"""Verify ability to create networks with host and link options
4041
(common code)."""
4142

42-
switchClass = None # overridden in subclasses
43+
apClass = None # overridden in subclasses
4344

4445
@staticmethod
4546
def tearDown():
@@ -49,10 +50,10 @@ def tearDown():
4950

5051
def runOptionsTopoTest( self, n, msg, hopts=None, lopts=None ):
5152
"Generic topology-with-options test runner."
52-
mn = Mininet( topo=SingleSwitchOptionsTopo( n=n, hopts=hopts,
53-
lopts=lopts ),
53+
mn = Mininet( topo=SingleAPOptionsTopo( n=n, hopts=hopts,
54+
lopts=lopts ),
5455
host=CPULimitedHost, link=TCLink,
55-
switch=self.switchClass, waitConnected=True)
56+
switch=self.apClass, waitConnected=True)
5657
dropped = mn.run( mn.ping )
5758
hoptsStr = ', '.join( '%s: %s' % ( opt, value )
5859
for opt, value in hopts.items() )
@@ -95,14 +96,14 @@ class testOptionsTopoOVSKernel( testOptionsTopoCommon, unittest.TestCase ):
9596
"""Verify ability to create networks with host and link options
9697
(OVS kernel switch)."""
9798
longMessage = True
98-
switchClass = OVSSwitch
99+
switchClass = OVSAP
99100

100101
@unittest.skip( 'Skipping OVS user switch test for now' )
101102
class testOptionsTopoOVSUser( testOptionsTopoCommon, unittest.TestCase ):
102103
"""Verify ability to create networks with host and link options
103104
(OVS user switch)."""
104105
longMessage = True
105-
switchClass = partial( OVSSwitch, datapath='user' )
106+
switchClass = partial( OVSAP, datapath='user' )
106107

107108
@unittest.skipUnless( quietRun( 'which ivs-ctl' ), 'IVS is not installed' )
108109
class testOptionsTopoIVS( testOptionsTopoCommon, unittest.TestCase ):
@@ -116,7 +117,7 @@ class testOptionsTopoUserspace( testOptionsTopoCommon, unittest.TestCase ):
116117
"""Verify ability to create networks with host and link options
117118
(UserSwitch)."""
118119
longMessage = True
119-
switchClass = UserSwitch
120+
apClass = UserAP
120121

121122
if __name__ == '__main__':
122123
setLogLevel( 'warning' )

mininet/test/test_switchdpidassignment.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def testDefaultDpid(self):
3131
"""Verify that the default dpid is assigned using a valid provided
3232
canonical apname if no dpid is passed in ap creation."""
3333
ap = Mininet_wifi(topo=Topo(),
34-
accessPoint=self.accessPointClass,
35-
station=Station, controller=Controller,
36-
).addAccessPoint('ap1')
34+
accessPoint=self.accessPointClass,
35+
station=Station, controller=Controller,
36+
).addAccessPoint('ap1')
3737
self.assertEqual(ap.defaultDpid(), ap.dpid)
3838

3939
def dpidFrom(self, num):
@@ -46,8 +46,8 @@ def testActualDpidAssignment(self):
4646
passed in ap creation."""
4747
dpid = self.dpidFrom(0xABCD)
4848
ap = Mininet_wifi(topo=Topo(), accessPoint=self.accessPointClass,
49-
station=Station, controller=Controller,
50-
).addAccessPoint('ap1', dpid=dpid)
49+
station=Station, controller=Controller,
50+
).addAccessPoint('ap1', dpid=dpid)
5151
self.assertEqual(ap.dpid, dpid)
5252

5353
def testDefaultDpidLen(self):
@@ -56,8 +56,8 @@ def testDefaultDpidLen(self):
5656
name) 0's followed by hex of first string of contiguous digits passed
5757
in ap name."""
5858
ap = Mininet_wifi(topo=Topo(), accessPoint=self.accessPointClass,
59-
station=Station, controller=Controller,
60-
).addAccessPoint('ap123')
59+
station=Station, controller=Controller,
60+
).addAccessPoint('ap123')
6161

6262
self.assertEqual(ap.dpid, self.dpidFrom(123))
6363

mininet/test/test_walkthrough.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import os
1010
import re
1111
from time import sleep
12+
from mininet.util import quietRun
1213
import pexpect
1314
from sys import version_info as py_version_info
1415

15-
from mininet.util import quietRun
1616

1717
def tsharkVersion():
1818
"Return tshark version"

mininet/topo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
setup for testing, and can even be emulated with the Mininet package.
1212
"""
1313

14-
from mininet.util import irange, natural, naturalSeq
1514
from sys import version_info as py_version_info
15+
from mininet.util import irange, natural, naturalSeq
1616

1717

1818
class MultiGraph( object ):

0 commit comments

Comments
 (0)