<s> from neutron . agent . l3 import agent <EOL> from neutron . agent . l3 import legacy_router <EOL> class DfDvrRouter ( legacy_router . LegacyRouter ) : <EOL> def add_floating_ip ( self , fip , interface_name , device ) : <EOL> if is_distributed_router ( self . router ) : <EOL> return <EOL> return super ( DfDvrRouter , self ) . add_floating_ip ( <EOL> fip , interface_name , device ) <EOL> def remove_floating_ip ( self , device , ip_cidr ) : <EOL> if is_distributed_router ( self . router ) : <EOL> return <EOL> super ( DfDvrRouter , self ) . remove_floating_ip ( <EOL> device , ip_cidr ) <EOL> def process_snat_dnat_for_fip ( self ) : <EOL> if is_distributed_router ( self . router ) : <EOL> return <EOL> super ( DfDvrRouter , self ) . process_snat_dnat_for_fip ( ) <EOL> class DfL3NATAgentWithStateReport ( agent . L3NATAgentWithStateReport ) : <EOL> def _create_router ( self , router_id , router ) : <EOL> args = [ ] <EOL> kwargs = { <EOL> '<STR_LIT>' : router_id , <EOL> '<STR_LIT>' : router , <EOL> '<STR_LIT>' : self . use_ipv6 , <EOL> '<STR_LIT>' : self . conf , <EOL> '<STR_LIT>' : self . driver , <EOL> } <EOL> if is_distributed_router ( router ) : <EOL> return DfDvrRouter ( * args , ** kwargs ) <EOL> return super ( DfL3NATAgentWithStateReport , self ) . _create_router ( <EOL> router_id , router ) <EOL> def is_distributed_router ( router ) : <EOL> return router . get ( '<STR_LIT>' , False ) </s>
