def take_action(self, parsed_args):
     neutron_client = self.get_client()
     _speaker_id = get_bgp_speaker_id(neutron_client,
                                      parsed_args.bgp_speaker)
     _peer_id = bgp_peer.get_bgp_peer_id(neutron_client,
                                         parsed_args.bgp_peer)
     neutron_client.remove_peer_from_bgp_speaker(_speaker_id,
                                                 {'bgp_peer_id': _peer_id})
     print(_('Removed BGP peer %(peer)s from BGP speaker %(speaker)s.') %
           {'peer':  parsed_args.bgp_peer,
            'speaker': parsed_args.bgp_speaker},
           file=self.app.stdout)
Example #2
0
 def run(self, parsed_args):
     neutron_client = self.get_client()
     _speaker_id = get_bgp_speaker_id(neutron_client,
                                      parsed_args.bgp_speaker)
     _peer_id = bgp_peer.get_bgp_peer_id(neutron_client,
                                         parsed_args.bgp_peer)
     neutron_client.add_peer_to_bgp_speaker(_speaker_id,
                                            {'bgp_peer_id': _peer_id})
     print(_('Added BGP peer %(peer)s to BGP speaker %(speaker)s.') %
           {'peer': parsed_args.bgp_peer,
            'speaker': parsed_args.bgp_speaker},
           file=self.app.stdout)
Example #3
0
 def take_action(self, parsed_args):
     neutron_client = self.get_client()
     _speaker_id = get_bgp_speaker_id(neutron_client,
                                      parsed_args.bgp_speaker)
     _peer_id = bgp_peer.get_bgp_peer_id(neutron_client,
                                         parsed_args.bgp_peer)
     neutron_client.remove_peer_from_bgp_speaker(_speaker_id,
                                                 {'bgp_peer_id': _peer_id})
     print(_('Removed BGP peer %(peer)s from BGP speaker %(speaker)s.') % {
         'peer': parsed_args.bgp_peer,
         'speaker': parsed_args.bgp_speaker
     },
           file=self.app.stdout)