@Text('announce flow')
def announce_flow (self, reactor, service, line):
	def callback ():
		try:
			descriptions,command = self.parser.extract_neighbors(line)
			peers = reactor.match_neighbors(descriptions)
			if not peers:
				self.log_failure('no neighbor matching the command : %s' % command,'warning')
				reactor.answer(service,'error')
				yield True
				return

			changes = self.parser.api_flow(command,peers)
			if not changes:
				self.log_failure('command could not parse flow in : %s' % command,'warning')
				reactor.answer(service,'error')
				yield True
				return

			for (peers,change) in changes:
				change.nlri.action = OUT.ANNOUNCE
				reactor.configuration.inject_change(peers,change)
				self.log_message('flow added to %s : %s' % (', '.join(peers) if peers else 'all peers',change.extensive()))
				yield False

			reactor.route_update = True
			reactor.answer(service,'done')
		except ValueError:
			self.log_failure('issue parsing the flow')
			reactor.answer(service,'error')
			yield True
		except __HOLE__:
			self.log_failure('issue parsing the flow')
			reactor.answer(service,'error')
			yield True

	reactor.plan(callback(),'announce_flow')
	return True
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/reactor/api/command/text.py/announce_flow