def bgp_peer_remove(ip, version): """ Remove a global BGP peer. :param ip: The address to use. :param version: 4 or 6 :return: None """ address = IPAddress(ip) try: client.remove_bgp_peer(version, address) except KeyError: print "%s is not a globally configured peer." % address sys.exit(1) else: print "BGP peer removed from global configuration"
def node_bgppeer_remove(ip, version): """ Remove a global BGP peer from this node. :param ip: The address to use. :param version: 4 or 6 :return: None """ address = IPAddress(ip) try: client.remove_bgp_peer(version, address, hostname=hostname) except KeyError: print "%s is not a configured peer for this node." % address sys.exit(1) else: print "BGP peer removed from node configuration"