@@ -80,7 +80,7 @@ def bridge_exists(self):
8080 def addresses (self , address = None , ifname = None , local = None ):
8181 """Returns the addresses associated with interfaces
8282
83- >>> host.iproute2.addresses()
83+ >>> host.iproute2() .addresses()
8484 [{'ifindex': 1,
8585 'ifname': 'lo',
8686 'flags': ['LOOPBACK', 'UP', 'LOWER_UP'],
@@ -114,11 +114,12 @@ def addresses(self, address=None, ifname=None, local=None):
114114 * local
115115
116116 """
117+ raise NotImplementedError
117118
118119 def links (self ):
119120 """Returns links and their state.
120121
121- >>> host.iproute2.links()
122+ >>> host.iproute2() .links()
122123 [{'ifindex': 1,
123124 'ifname': 'lo',
124125 'flags': ['LOOPBACK', 'UP', 'LOWER_UP'],
@@ -133,13 +134,14 @@ def links(self):
133134 'broadcast': '00:00:00:00:00:00'}]
134135
135136 """
137+ raise NotImplementedError
136138
137139 def routes (
138140 self , table = "all" , device = None , scope = None , proto = None , src = None , metric = None
139141 ):
140142 """Returns the routes installed in *all* routing tables.
141143
142- >>> host.iproute2.routes()
144+ >>> host.iproute2() .routes()
143145 [{'dst': '169.254.0.0/16',
144146 'dev': 'wlp4s0',
145147 'scope': 'link',
@@ -165,6 +167,7 @@ def routes(
165167 * metric
166168
167169 """
170+ raise NotImplementedError
168171
169172 def rules (
170173 self ,
@@ -182,7 +185,7 @@ def rules(
182185 ):
183186 """Returns the rules our routing policy consists of.
184187
185- >>> host.iproute2.rules()
188+ >>> host.iproute2() .rules()
186189 [{'priority': 0, 'src': 'all', 'table': 'local'},
187190 {'priority': 32765, 'src': '1.2.3.4', 'table': '123'},
188191 {'priority': 32766, 'src': 'all', 'table': 'main'},
@@ -204,11 +207,12 @@ def rules(
204207 * dport
205208
206209 """
210+ raise NotImplementedError
207211
208212 def tunnels (self , ifname = None ):
209213 """Returns all configured tunnels
210214
211- >>> host.iproute2.tunnels()
215+ >>> host.iproute2() .tunnels()
212216 [{'ifname': 'test1',
213217 'mode': 'ip/ip',
214218 'remote': '127.0.0.2',
@@ -220,51 +224,55 @@ def tunnels(self, ifname=None):
220224 * ifname
221225
222226 """
227+ raise NotImplementedError
223228
224229 def vrfs (self ):
225230 """Returns all configured vrfs"""
226- cmd = f"{ self ._ip } --json vrf show"
227- out = self .check_output (cmd )
228- return json .loads (out )
231+ raise NotImplementedError
229232
230233 def netns (self ):
231234 """Returns all configured network namespaces
232235
233- >>> host.iproute2.netns()
236+ >>> host.iproute2() .netns()
234237 [{'name': 'test'}]
235238 """
239+ raise NotImplementedError
236240
237241 def bridge_vlan (self ):
238242 """Returns all configured vlans
239243
240- >>> host.iproute2.bridge_vlan()
244+ >>> host.iproute2() .bridge_vlan()
241245 []
242246 """
247+ raise NotImplementedError
243248
244249 def bridge_fdb (self ):
245250 """Returns all configured fdb entries
246251
247- >>> host.iproute2.bridge_fdb()
252+ >>> host.iproute2() .bridge_fdb()
248253 [{'mac': '33:33:00:00:00:01',
249254 'ifname': 'enp0s31f6',
250255 'flags': ['self'],
251256 'state': 'permanent'}]
252257 """
258+ raise NotImplementedError
253259
254260 def bridge_mdb (self ):
255261 """Returns all configured mdb entries
256262
257- >>> host.iproute2.bridge_mdb()
263+ >>> host.iproute2() .bridge_mdb()
258264 [{'mdb': [], 'router': {}}]
259265
260266 """
267+ raise NotImplementedError
261268
262269 def bridge_link (self ):
263270 """Returns all configured links
264271
265- >>> host.iproute2.bridge_link()
272+ >>> host.iproute2() .bridge_link()
266273 []
267274 """
275+ raise NotImplementedError
268276
269277
270278class LinuxIProute2 (IProute2 ):
@@ -307,7 +315,7 @@ def bridge_exists(self):
307315 def addresses (self , address = None , ifname = None , local = None ):
308316 """Returns the addresses associated with interfaces
309317
310- >>> host.iproute2.addresses()
318+ >>> host.iproute2() .addresses()
311319 [{'ifindex': 1,
312320 'ifname': 'lo',
313321 'flags': ['LOOPBACK', 'UP', 'LOWER_UP'],
@@ -362,7 +370,7 @@ def addresses(self, address=None, ifname=None, local=None):
362370 def links (self ):
363371 """Returns links and their state.
364372
365- >>> host.iproute2.links()
373+ >>> host.iproute2() .links()
366374 [{'ifindex': 1,
367375 'ifname': 'lo',
368376 'flags': ['LOOPBACK', 'UP', 'LOWER_UP'],
@@ -386,7 +394,7 @@ def routes(
386394 ):
387395 """Returns the routes installed in *all* routing tables.
388396
389- >>> host.iproute2.routes()
397+ >>> host.iproute2() .routes()
390398 [{'dst': '169.254.0.0/16',
391399 'dev': 'wlp4s0',
392400 'scope': 'link',
@@ -447,7 +455,7 @@ def rules(
447455 ):
448456 """Returns the rules our routing policy consists of.
449457
450- >>> host.iproute2.rules()
458+ >>> host.iproute2() .rules()
451459 [{'priority': 0, 'src': 'all', 'table': 'local'},
452460 {'priority': 32765, 'src': '1.2.3.4', 'table': '123'},
453461 {'priority': 32766, 'src': 'all', 'table': 'main'},
@@ -512,7 +520,7 @@ def rules(
512520 def tunnels (self , ifname = None ):
513521 """Returns all configured tunnels
514522
515- >>> host.iproute2.tunnels()
523+ >>> host.iproute2() .tunnels()
516524 [{'ifname': 'test1',
517525 'mode': 'ip/ip',
518526 'remote': '127.0.0.2',
@@ -543,7 +551,7 @@ def vrfs(self):
543551 def netns (self ):
544552 """Returns all configured network namespaces
545553
546- >>> host.iproute2.netns()
554+ >>> host.iproute2() .netns()
547555 [{'name': 'test'}]
548556 """
549557
@@ -556,7 +564,7 @@ def netns(self):
556564 def bridge_vlan (self ):
557565 """Returns all configured vlans
558566
559- >>> host.iproute2.bridge_vlan()
567+ >>> host.iproute2() .bridge_vlan()
560568 []
561569 """
562570
@@ -567,7 +575,7 @@ def bridge_vlan(self):
567575 def bridge_fdb (self ):
568576 """Returns all configured fdb entries
569577
570- >>> host.iproute2.bridge_fdb()
578+ >>> host.iproute2() .bridge_fdb()
571579 [{'mac': '33:33:00:00:00:01',
572580 'ifname': 'enp0s31f6',
573581 'flags': ['self'],
@@ -581,7 +589,7 @@ def bridge_fdb(self):
581589 def bridge_mdb (self ):
582590 """Returns all configured mdb entries
583591
584- >>> host.iproute2.bridge_mdb()
592+ >>> host.iproute2() .bridge_mdb()
585593 [{'mdb': [], 'router': {}}]
586594
587595 """
@@ -593,7 +601,7 @@ def bridge_mdb(self):
593601 def bridge_link (self ):
594602 """Returns all configured links
595603
596- >>> host.iproute2.bridge_link()
604+ >>> host.iproute2() .bridge_link()
597605 []
598606 """
599607
0 commit comments