Advertisement
Guest User

Untitled

a guest
Mar 28th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.23 KB | None | 0 0
  1. diff -r dbcec00e9755 sa/profiles/Cisco/IOS/get_mpls_vpn.py
  2. --- a/sa/profiles/Cisco/IOS/get_mpls_vpn.py Tue Mar 27 21:38:04 2012 +0400
  3. +++ b/sa/profiles/Cisco/IOS/get_mpls_vpn.py Wed Mar 28 09:58:34 2012 +0400
  4. @@ -18,7 +18,7 @@
  5.      implements = [IGetMPLSVPN]
  6.  
  7.      rx_line = re.compile(r"^\s+(?P<vrf>.+?)\s+"
  8. -                         r"(?P<rd>\S+:\S+)\s+(?P<iface>.+?)\s*$")
  9. +                         r"(?P<rd>\S+:\S+)\s+(?P<iface>.*?)\s*$")
  10.      rx_cont = re.compile("^\s{6,}(?P<iface>.+?)\s*$")
  11.  
  12.      def execute(self, **kwargs):
  13. @@ -27,12 +27,17 @@
  14.          for l in v.splitlines():
  15.              match = self.rx_line.match(l)
  16.              if match:
  17. +                iface = match.group("iface").strip()
  18. +                if iface:
  19. +                    interfaces = [iface]
  20. +                else:
  21. +                    interfaces = []
  22.                  vpns += [{
  23.                      "type": "VRF",
  24.                      "status": True,
  25.                      "name": match.group("vrf"),
  26.                      "rd": match.group("rd"),
  27. -                    "interfaces": [match.group("iface")]
  28. +                    "interfaces": interfaces
  29.                  }]
  30.              elif vpns:
  31.                  match = self.rx_cont.match(l)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement