@@ -273,8 +273,8 @@ def body(self, master):
273
273
Label (self .leftfieldFrame , text = "Default AP:" ).grid (row = 3 , sticky = E )
274
274
self .apType = StringVar (self .leftfieldFrame )
275
275
self .apTypeMenu = OptionMenu (self .leftfieldFrame , self .apType , "Open vSwitch Kernel Mode" ,
276
- "Indigo Virtual AP" , "Userspace AP" ,
277
- "Userspace AP inNamespace" )
276
+ "Indigo Virtual AP" , "Userspace AP" ,
277
+ "Userspace AP inNamespace" )
278
278
self .switchTypeMenu .grid (row = 3 , column = 1 , sticky = W )
279
279
apTypePref = self .prefValues ['apType' ]
280
280
if apTypePref == 'ivs' :
@@ -290,7 +290,7 @@ def body(self, master):
290
290
Label (self .leftfieldFrame , text = "Mode:" ).grid (row = 3 , sticky = E )
291
291
self .mode = StringVar (self .leftfieldFrame )
292
292
self .modeMenu = OptionMenu (self .leftfieldFrame , self .mode , "g" , "a" ,
293
- "b" , "n" )
293
+ "b" , "n" )
294
294
self .modeMenu .grid (row = 3 , column = 1 , sticky = W )
295
295
modePref = self .prefValues ['mode' ]
296
296
if modePref == 'g' :
@@ -508,11 +508,11 @@ def __init__(self, master, _title):
508
508
buttonFrame .grid (row = 1 , column = 0 , sticky = 'nswe' )
509
509
510
510
okButton = Button (buttonFrame , width = 8 , text = 'OK' , relief = 'groove' ,
511
- bd = 4 , command = self .okAction )
511
+ bd = 4 , command = self .okAction )
512
512
okButton .grid (row = 0 , column = 0 , sticky = E )
513
513
514
514
canlceButton = Button (buttonFrame , width = 8 , text = 'Cancel' , relief = 'groove' ,
515
- bd = 4 , command = self .cancelAction )
515
+ bd = 4 , command = self .cancelAction )
516
516
canlceButton .grid (row = 0 , column = 1 , sticky = W )
517
517
518
518
def body (self , master ):
@@ -680,14 +680,12 @@ def addInterface( self ):
680
680
def apply (self ):
681
681
externalInterfaces = []
682
682
for row in range (self .tableFrame .rows ):
683
- if (len (self .tableFrame .get (row , 0 )) > 0 and
684
- row > 0 ):
683
+ if (len (self .tableFrame .get (row , 0 )) > 0 and row > 0 ):
685
684
externalInterfaces .append (self .tableFrame .get (row , 0 ))
686
685
vlanInterfaces = []
687
686
for row in range (self .vlanTableFrame .rows ):
688
- if (len (self .vlanTableFrame .get (row , 0 )) > 0 and
689
- len (self .vlanTableFrame .get (row , 1 )) > 0 and
690
- row > 0 ):
687
+ if (len (self .vlanTableFrame .get (row , 0 )) > 0
688
+ and len (self .vlanTableFrame .get (row , 1 )) > 0 and row > 0 ):
691
689
vlanInterfaces .append ([self .vlanTableFrame .get (row , 0 ), self .vlanTableFrame .get (row , 1 )])
692
690
privateDirectories = []
693
691
for row in range (self .mountTableFrame .rows ):
@@ -863,14 +861,12 @@ def addInterface( self ):
863
861
def apply (self ):
864
862
externalInterfaces = []
865
863
for row in range (self .tableFrame .rows ):
866
- if (len (self .tableFrame .get (row , 0 )) > 0 and
867
- row > 0 ):
864
+ if (len (self .tableFrame .get (row , 0 )) > 0 and row > 0 ):
868
865
externalInterfaces .append (self .tableFrame .get (row , 0 ))
869
866
vlanInterfaces = []
870
867
for row in range (self .vlanTableFrame .rows ):
871
868
if (len (self .vlanTableFrame .get (row , 0 )) > 0 and
872
- len (self .vlanTableFrame .get (row , 1 )) > 0 and
873
- row > 0 ):
869
+ len (self .vlanTableFrame .get (row , 1 )) > 0 and row > 0 ):
874
870
vlanInterfaces .append ([self .vlanTableFrame .get (row , 0 ), self .vlanTableFrame .get (row , 1 )])
875
871
privateDirectories = []
876
872
for row in range (self .mountTableFrame .rows ):
@@ -1048,12 +1044,11 @@ def apply(self):
1048
1044
1049
1045
dpid = self .dpidEntry .get ()
1050
1046
if (self .defaultDpid (self .hostnameEntry .get ()) is None
1051
- and len (dpid ) == 0 ):
1047
+ and len (dpid ) == 0 ):
1052
1048
showerror (title = "Error" ,
1053
- message = 'Unable to derive default datapath ID - '
1054
- 'please either specify a DPID or use a '
1055
- 'canonical switch name such as s23.' )
1056
-
1049
+ message = 'Unable to derive default datapath ID - '
1050
+ 'please either specify a DPID or use a '
1051
+ 'canonical switch name such as s23.' )
1057
1052
1058
1053
results = {'externalInterfaces' :externalInterfaces ,
1059
1054
'hostname' :self .hostnameEntry .get (),
@@ -1148,8 +1143,9 @@ def body(self, master):
1148
1143
# Selection of authentication
1149
1144
Label (self .leftfieldFrame , text = "Authentication:" ).grid (row = rowCount , sticky = E )
1150
1145
self .authentication = StringVar (self .leftfieldFrame )
1151
- self .authenticationMenu = OptionMenu (self .leftfieldFrame , self .authentication , "none" , "WEP" ,
1152
- "WPA" , "WPA2" )
1146
+ self .authenticationMenu = OptionMenu (self .leftfieldFrame ,
1147
+ self .authentication , "none" , "WEP" ,
1148
+ "WPA" , "WPA2" )
1153
1149
self .authenticationMenu .grid (row = rowCount , column = 1 , sticky = W )
1154
1150
if 'authentication' in self .prefValues :
1155
1151
authPref = self .prefValues ['authentication' ]
@@ -1295,10 +1291,9 @@ def apply(self):
1295
1291
if (self .defaultDpid (self .hostnameEntry .get ()) is None
1296
1292
and len (dpid ) == 0 ):
1297
1293
showerror (title = "Error" ,
1298
- message = 'Unable to derive default datapath ID - '
1299
- 'please either specify a DPID or use a '
1300
- 'canonical switch name such as s23.' )
1301
-
1294
+ message = 'Unable to derive default datapath ID - '
1295
+ 'please either specify a DPID or use a '
1296
+ 'canonical switch name such as s23.' )
1302
1297
1303
1298
results = {'externalInterfaces' :externalInterfaces ,
1304
1299
'hostname' :self .hostnameEntry .get (),
@@ -1871,7 +1866,7 @@ def updateScrollRegion( self ):
1871
1866
bbox = self .canvas .bbox ( 'all' )
1872
1867
if bbox is not None :
1873
1868
self .canvas .configure ( scrollregion = ( 0 , 0 , bbox [ 2 ],
1874
- bbox [ 3 ] ) )
1869
+ bbox [ 3 ] ) )
1875
1870
1876
1871
def canvasx ( self , x_root ):
1877
1872
"Convert root x coordinate to canvas coordinate."
@@ -2239,7 +2234,7 @@ def loadTopology( self ):
2239
2234
dx , dy = self .canvas .coords ( self .widgetToItem [ dest ] )
2240
2235
2241
2236
self .link = self .canvas .create_line ( sx , sy , dx , dy , width = 4 ,
2242
- fill = 'blue' , tag = 'link' )
2237
+ fill = 'blue' , tag = 'link' )
2243
2238
c .itemconfig (self .link , tags = c .gettags (self .link )+ ('data' ,))
2244
2239
self .addLink ( src , dest , linkopts = link ['opts' ] )
2245
2240
self .createDataLinkBindings ()
@@ -3144,20 +3139,20 @@ def finishLink( self, event ):
3144
3139
target = self .findItem ( x , y )
3145
3140
dest = self .itemToWidget .get ( target , None )
3146
3141
if ( source is None or dest is None or source == dest
3147
- or dest in source .links or source in dest .links ):
3142
+ or dest in source .links or source in dest .links ):
3148
3143
self .releaseNetLink ( event )
3149
3144
return
3150
3145
# For now, don't allow hosts to be directly linked
3151
3146
stags = self .canvas .gettags ( self .widgetToItem [ source ] )
3152
3147
dtags = self .canvas .gettags ( target )
3153
3148
if (('Host' in stags and 'Host' in dtags ) or
3154
- ('Controller' in dtags and 'LegacyRouter' in stags ) or
3155
- ('Controller' in stags and 'LegacyRouter' in dtags ) or
3156
- ('Controller' in dtags and 'LegacySwitch' in stags ) or
3157
- ('Controller' in stags and 'LegacySwitch' in dtags ) or
3158
- ('Controller' in dtags and 'Host' in stags ) or
3159
- ('Controller' in stags and 'Host' in dtags ) or
3160
- ('Controller' in stags and 'Controller' in dtags )):
3149
+ ('Controller' in dtags and 'LegacyRouter' in stags ) or
3150
+ ('Controller' in stags and 'LegacyRouter' in dtags ) or
3151
+ ('Controller' in dtags and 'LegacySwitch' in stags ) or
3152
+ ('Controller' in stags and 'LegacySwitch' in dtags ) or
3153
+ ('Controller' in dtags and 'Host' in stags ) or
3154
+ ('Controller' in stags and 'Host' in dtags ) or
3155
+ ('Controller' in stags and 'Controller' in dtags )):
3161
3156
self .releaseNetLink ( event )
3162
3157
return
3163
3158
@@ -3753,11 +3748,8 @@ def buildNodes( self, net):
3753
3748
else :
3754
3749
hostCls = Host
3755
3750
debug ( hostCls , '\n ' )
3756
- newHost = net .addHost ( name ,
3757
- cls = hostCls ,
3758
- ip = ip ,
3759
- defaultRoute = defaultRoute
3760
- )
3751
+ newHost = net .addHost ( name , cls = hostCls , ip = ip ,
3752
+ defaultRoute = defaultRoute )
3761
3753
3762
3754
# Set the CPULimitedHost specific options
3763
3755
if 'cores' in opts :
@@ -3803,11 +3795,8 @@ def buildNodes( self, net):
3803
3795
else :
3804
3796
hostCls = Host
3805
3797
debug ( hostCls , '\n ' )
3806
- newStation = net .addStation ( name ,
3807
- cls = hostCls ,
3808
- ip = ip ,
3809
- defaultRoute = defaultRoute
3810
- )
3798
+ newStation = net .addStation ( name , cls = hostCls ,
3799
+ ip = ip , defaultRoute = defaultRoute )
3811
3800
3812
3801
# Set the CPULimitedHost specific options
3813
3802
if 'cores' in opts :
@@ -3873,9 +3862,9 @@ def pathCheck( *args, **kwargs ):
3873
3862
for arg in args :
3874
3863
if not quietRun ( 'which ' + arg ):
3875
3864
showerror (title = "Error" ,
3876
- message = 'Cannot find required executable %s.\n ' % arg +
3877
- 'Please make sure that %s is installed ' % moduleName +
3878
- 'and available in your $PATH.' )
3865
+ message = 'Cannot find required executable %s.\n ' % arg +
3866
+ 'Please make sure that %s is installed ' % moduleName +
3867
+ 'and available in your $PATH.' )
3879
3868
3880
3869
def buildLinks ( self , net ):
3881
3870
# Make links
0 commit comments