Skip to content

Commit ab05f84

Browse files
committed
autopep8 action fixes
1 parent 71ec8c8 commit ab05f84

File tree

6 files changed

+94
-94
lines changed

6 files changed

+94
-94
lines changed

nets-in-progress/8r-1c-srv6-pm/isis8d.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from mininet.util import dumpNodeConnections
2121

2222
# BASEDIR = "/home/user/mytests/ospf3routers/nodeconf/"
23-
BASEDIR = os.getcwd()+"/nodeconf/"
23+
BASEDIR = os.getcwd() + "/nodeconf/"
2424
OUTPUT_PID_TABLE_FILE = "/tmp/pid_table_file.txt"
2525

2626
PRIVDIR = '/var/priv'
@@ -72,9 +72,9 @@ def config(self, **kwargs):
7272
# first = False
7373
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
7474
# let's write the hostname in /var/mininet/hostname
75-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
76-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
77-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
75+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
76+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
77+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
7878

7979
def cleanup(self):
8080
def remove_if_exists(filename):
@@ -86,13 +86,13 @@ def remove_if_exists(filename):
8686
if os.path.exists(self.dir):
8787
shutil.rmtree(self.dir)
8888

89-
remove_if_exists(BASEDIR+self.name+"/zebra.pid")
90-
remove_if_exists(BASEDIR+self.name+"/zebra.log")
91-
remove_if_exists(BASEDIR+self.name+"/zebra.sock")
92-
remove_if_exists(BASEDIR+self.name+"/isis8d.pid")
93-
remove_if_exists(BASEDIR+self.name+"/isis8d.log")
94-
remove_if_exists(BASEDIR+self.name+"/isisd.log")
95-
remove_if_exists(BASEDIR+self.name+"/isisd.pid")
89+
remove_if_exists(BASEDIR + self.name + "/zebra.pid")
90+
remove_if_exists(BASEDIR + self.name + "/zebra.log")
91+
remove_if_exists(BASEDIR + self.name + "/zebra.sock")
92+
remove_if_exists(BASEDIR + self.name + "/isis8d.pid")
93+
remove_if_exists(BASEDIR + self.name + "/isis8d.log")
94+
remove_if_exists(BASEDIR + self.name + "/isisd.log")
95+
remove_if_exists(BASEDIR + self.name + "/isisd.pid")
9696

9797
remove_if_exists(OUTPUT_PID_TABLE_FILE)
9898

@@ -153,9 +153,9 @@ def config(self, **kwargs):
153153
# first = False
154154
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
155155
# let's write the hostname in /var/mininet/hostname
156-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
157-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
158-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
156+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
157+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
158+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
159159

160160
def cleanup(self):
161161
# def remove_if_exists(filename):
@@ -171,8 +171,8 @@ def cleanup(self):
171171
# the add_link function creates a link and assigns the interface names
172172
# as node1-node2 and node2-node1
173173
def add_link(my_net, node1, node2):
174-
my_net.addLink(node1, node2, intfName1=node1.name+'-'+node2.name,
175-
intfName2=node2.name+'-'+node1.name)
174+
my_net.addLink(node1, node2, intfName1=node1.name + '-' + node2.name,
175+
intfName2=node2.name + '-' + node1.name)
176176

177177

178178
def create_topo(my_net):
@@ -311,8 +311,8 @@ def stop_all():
311311

312312

313313
def extract_host_pid(dumpline):
314-
temp = dumpline[dumpline.find('pid=')+4:]
315-
return int(temp[:len(temp)-2])
314+
temp = dumpline[dumpline.find('pid=') + 4:]
315+
return int(temp[:len(temp) - 2])
316316

317317

318318
def simple_test():

nets-unmantained/3routers/ospf3r.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from mininet.util import dumpNodeConnections
1717

1818
# BASEDIR = "/home/user/mytests/ospf3routers/nodeconf/"
19-
BASEDIR = os.getcwd()+"/nodeconf/"
19+
BASEDIR = os.getcwd() + "/nodeconf/"
2020
OUTPUT_PID_TABLE_FILE = "/tmp/pid_table_file.txt"
2121

2222
PRIVDIR = '/var/priv'
@@ -47,9 +47,9 @@ def config(self, **kwargs):
4747
# first = False
4848
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
4949
# let's write the hostname in /var/mininet/hostname
50-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
51-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
52-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
50+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
51+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
52+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
5353

5454
def cleanup(self):
5555
def remove_if_exists(filename):
@@ -61,11 +61,11 @@ def remove_if_exists(filename):
6161
if os.path.exists(self.dir):
6262
shutil.rmtree(self.dir)
6363

64-
remove_if_exists(BASEDIR+self.name+"/zebra.pid")
65-
remove_if_exists(BASEDIR+self.name+"/zebra.log")
66-
remove_if_exists(BASEDIR+self.name+"/zebra.sock")
67-
remove_if_exists(BASEDIR+self.name+"/ospfd.pid")
68-
remove_if_exists(BASEDIR+self.name+"/ospfd.log")
64+
remove_if_exists(BASEDIR + self.name + "/zebra.pid")
65+
remove_if_exists(BASEDIR + self.name + "/zebra.log")
66+
remove_if_exists(BASEDIR + self.name + "/zebra.sock")
67+
remove_if_exists(BASEDIR + self.name + "/ospfd.pid")
68+
remove_if_exists(BASEDIR + self.name + "/ospfd.log")
6969
remove_if_exists(OUTPUT_PID_TABLE_FILE)
7070

7171
# if os.path.exists(BASEDIR+self.name+"/zebra.pid"):
@@ -96,8 +96,8 @@ def __init__(self, name, *args, **kwargs):
9696

9797

9898
def add_link(node1, node2):
99-
Link(node1, node2, intfName1=node1.name+'-'+node2.name,
100-
intfName2=node2.name+'-'+node1.name)
99+
Link(node1, node2, intfName1=node1.name + '-' + node2.name,
100+
intfName2=node2.name + '-' + node1.name)
101101

102102

103103
def create_topo(my_net):
@@ -137,8 +137,8 @@ def stop_all():
137137

138138

139139
def extract_host_pid(dumpline):
140-
temp = dumpline[dumpline.find('pid=')+4:]
141-
return int(temp[:len(temp)-2])
140+
temp = dumpline[dumpline.find('pid=') + 4:]
141+
return int(temp[:len(temp) - 2])
142142

143143

144144
def simple_test():

nets-unmantained/8r-1c-out-band-isis/isis8d.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from mininet.util import dumpNodeConnections
2121

2222
# BASEDIR = "/home/user/mytests/ospf3routers/nodeconf/"
23-
BASEDIR = os.getcwd()+"/nodeconf/"
23+
BASEDIR = os.getcwd() + "/nodeconf/"
2424
OUTPUT_PID_TABLE_FILE = "/tmp/pid_table_file.txt"
2525

2626
PRIVDIR = '/var/priv'
@@ -72,9 +72,9 @@ def config(self, **kwargs):
7272
# first = False
7373
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
7474
# let's write the hostname in /var/mininet/hostname
75-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
76-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
77-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
75+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
76+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
77+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
7878

7979
def cleanup(self):
8080
def remove_if_exists(filename):
@@ -86,13 +86,13 @@ def remove_if_exists(filename):
8686
if os.path.exists(self.dir):
8787
shutil.rmtree(self.dir)
8888

89-
remove_if_exists(BASEDIR+self.name+"/zebra.pid")
90-
remove_if_exists(BASEDIR+self.name+"/zebra.log")
91-
remove_if_exists(BASEDIR+self.name+"/zebra.sock")
92-
remove_if_exists(BASEDIR+self.name+"/isis8d.pid")
93-
remove_if_exists(BASEDIR+self.name+"/isis8d.log")
94-
remove_if_exists(BASEDIR+self.name+"/isisd.log")
95-
remove_if_exists(BASEDIR+self.name+"/isisd.pid")
89+
remove_if_exists(BASEDIR + self.name + "/zebra.pid")
90+
remove_if_exists(BASEDIR + self.name + "/zebra.log")
91+
remove_if_exists(BASEDIR + self.name + "/zebra.sock")
92+
remove_if_exists(BASEDIR + self.name + "/isis8d.pid")
93+
remove_if_exists(BASEDIR + self.name + "/isis8d.log")
94+
remove_if_exists(BASEDIR + self.name + "/isisd.log")
95+
remove_if_exists(BASEDIR + self.name + "/isisd.pid")
9696

9797
remove_if_exists(OUTPUT_PID_TABLE_FILE)
9898

@@ -152,9 +152,9 @@ def config(self, **kwargs):
152152
# first = False
153153
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
154154
# let's write the hostname in /var/mininet/hostname
155-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
156-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
157-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
155+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
156+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
157+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
158158

159159
def cleanup(self):
160160
# def remove_if_exists(filename):
@@ -170,8 +170,8 @@ def cleanup(self):
170170
# the add_link function creates a link and assigns the interface names
171171
# as node1-node2 and node2-node1
172172
def add_link(my_net, node1, node2):
173-
my_net.addLink(node1, node2, intfName1=node1.name+'-'+node2.name,
174-
intfName2=node2.name+'-'+node1.name)
173+
my_net.addLink(node1, node2, intfName1=node1.name + '-' + node2.name,
174+
intfName2=node2.name + '-' + node1.name)
175175

176176

177177
def create_topo(my_net):
@@ -310,8 +310,8 @@ def stop_all():
310310

311311

312312
def extract_host_pid(dumpline):
313-
temp = dumpline[dumpline.find('pid=')+4:]
314-
return int(temp[:len(temp)-2])
313+
temp = dumpline[dumpline.find('pid=') + 4:]
314+
return int(temp[:len(temp) - 2])
315315

316316

317317
def simple_test():

nets-unmantained/8routers/ospf8r.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from mininet.util import dumpNodeConnections
1919

2020
# BASEDIR = "/home/user/mytests/ospf3routers/nodeconf/"
21-
BASEDIR = os.getcwd()+"/nodeconf/"
21+
BASEDIR = os.getcwd() + "/nodeconf/"
2222
OUTPUT_PID_TABLE_FILE = "/tmp/pid_table_file.txt"
2323

2424
PRIVDIR = '/var/priv'
@@ -56,9 +56,9 @@ def config(self, **kwargs):
5656
# first = False
5757
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
5858
# let's write the hostname in /var/mininet/hostname
59-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
60-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
61-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
59+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
60+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
61+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
6262

6363
def cleanup(self):
6464
def remove_if_exists(filename):
@@ -70,13 +70,13 @@ def remove_if_exists(filename):
7070
if os.path.exists(self.dir):
7171
shutil.rmtree(self.dir)
7272

73-
remove_if_exists(BASEDIR+self.name+"/zebra.pid")
74-
remove_if_exists(BASEDIR+self.name+"/zebra.log")
75-
remove_if_exists(BASEDIR+self.name+"/zebra.sock")
76-
remove_if_exists(BASEDIR+self.name+"/ospf6d.pid")
77-
remove_if_exists(BASEDIR+self.name+"/ospf6d.log")
78-
remove_if_exists(BASEDIR+self.name+"/ospfd.log")
79-
remove_if_exists(BASEDIR+self.name+"/ospfd.pid")
73+
remove_if_exists(BASEDIR + self.name + "/zebra.pid")
74+
remove_if_exists(BASEDIR + self.name + "/zebra.log")
75+
remove_if_exists(BASEDIR + self.name + "/zebra.sock")
76+
remove_if_exists(BASEDIR + self.name + "/ospf6d.pid")
77+
remove_if_exists(BASEDIR + self.name + "/ospf6d.log")
78+
remove_if_exists(BASEDIR + self.name + "/ospfd.log")
79+
remove_if_exists(BASEDIR + self.name + "/ospfd.pid")
8080

8181
remove_if_exists(OUTPUT_PID_TABLE_FILE)
8282

@@ -108,8 +108,8 @@ def __init__(self, name, *args, **kwargs):
108108

109109

110110
def add_link(my_net, node1, node2):
111-
my_net.addLink(node1, node2, intfName1=node1.name+'-'+node2.name,
112-
intfName2=node2.name+'-'+node1.name)
111+
my_net.addLink(node1, node2, intfName1=node1.name + '-' + node2.name,
112+
intfName2=node2.name + '-' + node1.name)
113113

114114

115115
def create_topo(my_net):
@@ -226,8 +226,8 @@ def stop_all():
226226

227227

228228
def extract_host_pid(dumpline):
229-
temp = dumpline[dumpline.find('pid=')+4:]
230-
return int(temp[:len(temp)-2])
229+
temp = dumpline[dumpline.find('pid=') + 4:]
230+
return int(temp[:len(temp) - 2])
231231

232232

233233
def simple_test():

nets/8r-1c-in-band-isis/isis8d.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from mininet.util import dumpNodeConnections
2121

2222
# BASEDIR = "/home/user/mytests/ospf3routers/nodeconf/"
23-
BASEDIR = os.getcwd()+"/nodeconf/"
23+
BASEDIR = os.getcwd() + "/nodeconf/"
2424
OUTPUT_PID_TABLE_FILE = "/tmp/pid_table_file.txt"
2525

2626
PRIVDIR = '/var/priv'
@@ -72,9 +72,9 @@ def config(self, **kwargs):
7272
# first = False
7373
# self.cmd('ip a a %s dev %s' %(kwargs['mgmtip'], intf.name))
7474
# let's write the hostname in /var/mininet/hostname
75-
self.cmd("echo '" + self.name + "' > "+PRIVDIR+"/hostname")
76-
if os.path.isfile(BASEDIR+self.name+"/start.sh"):
77-
self.cmd('source %s' % BASEDIR+self.name+"/start.sh")
75+
self.cmd("echo '" + self.name + "' > " + PRIVDIR + "/hostname")
76+
if os.path.isfile(BASEDIR + self.name + "/start.sh"):
77+
self.cmd('source %s' % BASEDIR + self.name + "/start.sh")
7878

7979
def cleanup(self):
8080
def remove_if_exists(filename):
@@ -86,13 +86,13 @@ def remove_if_exists(filename):
8686
if os.path.exists(self.dir):
8787
shutil.rmtree(self.dir)
8888

89-
remove_if_exists(BASEDIR+self.name+"/zebra.pid")
90-
remove_if_exists(BASEDIR+self.name+"/zebra.log")
91-
remove_if_exists(BASEDIR+self.name+"/zebra.sock")
92-
remove_if_exists(BASEDIR+self.name+"/isis8d.pid")
93-
remove_if_exists(BASEDIR+self.name+"/isis8d.log")
94-
remove_if_exists(BASEDIR+self.name+"/isisd.log")
95-
remove_if_exists(BASEDIR+self.name+"/isisd.pid")
89+
remove_if_exists(BASEDIR + self.name + "/zebra.pid")
90+
remove_if_exists(BASEDIR + self.name + "/zebra.log")
91+
remove_if_exists(BASEDIR + self.name + "/zebra.sock")
92+
remove_if_exists(BASEDIR + self.name + "/isis8d.pid")
93+
remove_if_exists(BASEDIR + self.name + "/isis8d.log")
94+
remove_if_exists(BASEDIR + self.name + "/isisd.log")
95+
remove_if_exists(BASEDIR + self.name + "/isisd.pid")
9696

9797
remove_if_exists(OUTPUT_PID_TABLE_FILE)
9898

@@ -131,8 +131,8 @@ def config(self, **kwargs):
131131
# the add_link function creates a link and assigns the interface names
132132
# as node1-node2 and node2-node1
133133
def add_link(my_net, node1, node2):
134-
my_net.addLink(node1, node2, intfName1=node1.name+'-'+node2.name,
135-
intfName2=node2.name+'-'+node1.name)
134+
my_net.addLink(node1, node2, intfName1=node1.name + '-' + node2.name,
135+
intfName2=node2.name + '-' + node1.name)
136136

137137

138138
def create_topo(my_net):
@@ -254,8 +254,8 @@ def stop_all():
254254

255255

256256
def extract_host_pid(dumpline):
257-
temp = dumpline[dumpline.find('pid=')+4:]
258-
return int(temp[:len(temp)-2])
257+
temp = dumpline[dumpline.find('pid=') + 4:]
258+
return int(temp[:len(temp) - 2])
259259

260260

261261
def simple_test():

0 commit comments

Comments
 (0)