Advertisement
Guest User

Untitled

a guest
Jul 18th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Заменить вот это
  2. for l in vlans.split("\n"):
  3. match = rx_line.match(l.strip())
  4. if match:
  5. r.append({
  6. "vlan_id": match.group("vlan_id"),
  7. "mac": match.group("mac"),
  8. "interfaces": [match.group("interfaces")],
  9. "type": {"Dynamic": "D"}[match.group("type")],
  10. })
  11.  
  12. На вот это
  13.  
  14.  
  15. for l in vlans.split("\n"):
  16. match = rx_line.match(l.strip())
  17. if match:
  18. try:
  19. r.append({
  20. "vlan_id": match.group("vlan_id"),
  21. "mac": match.group("mac"),
  22. "interfaces": [match.group("interfaces")],
  23. "type": {"Dynamic": "D"}[match.group("type")],
  24. })
  25. except KeyError:
  26. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement