def prepare_router_vm_msg(self, tenant_id, tenant_name, router_id, net_id,<EOL>subnet_id, seg, status):
max_get_router_info_retry = True<EOL>attempt = <NUM_LIT:0><EOL>while max_get_router_info_retry:<EOL><INDENT>port_data = self.os_helper.get_router_port_subnet(subnet_id)<EOL>if port_data is None:<EOL><INDENT>LOG.error("<STR_LIT>")<EOL>return None<EOL><DEDENT>if port_data.get('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>time.sleep(<NUM_LIT:3>)<EOL>attempt += <NUM_LIT:1><EOL>if attempt > <NUM_LIT:3>:<EOL><INDENT>max_get_router_info_retry = False<EOL>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>max_get_router_info_retry = False<EOL><DEDENT><DEDENT>if status is '<STR_LIT>':<EOL><INDENT>event_type = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>event_type = '<STR_LIT>'<EOL><DEDENT>vnic_data = {'<STR_LIT:status>': status, '<STR_LIT>': port_data.get('<STR_LIT>'),<EOL>'<STR_LIT>': seg, '<STR_LIT:host>': port_data.get('<STR_LIT>')}<EOL>if vnic_data['<STR_LIT:host>'] == '<STR_LIT>':<EOL><INDENT>LOG.error("<STR_LIT>",<EOL>{'<STR_LIT>': seg, '<STR_LIT>': subnet_id})<EOL>if self.tenant_dict.get(tenant_id).get('<STR_LIT:host>') is None:<EOL><INDENT>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>{'<STR_LIT>': tenant_id, '<STR_LIT>': seg,<EOL>'<STR_LIT>': subnet_id})<EOL>return None<EOL><DEDENT>else:<EOL><INDENT>vnic_data['<STR_LIT:host>'] = self.tenant_dict.get(tenant_id).get('<STR_LIT:host>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.tenant_dict[tenant_id]['<STR_LIT:host>'] = vnic_data['<STR_LIT:host>']<EOL><DEDENT>vm_ip = port_data.get('<STR_LIT>')[<NUM_LIT:0>].get('<STR_LIT>')<EOL>vnic_data.update({'<STR_LIT>': port_data.get('<STR_LIT:id>'), '<STR_LIT>': net_id,<EOL>'<STR_LIT>': '<STR_LIT>' + tenant_name,<EOL>'<STR_LIT>': vm_ip, '<STR_LIT>': router_id, '<STR_LIT>': None,<EOL>'<STR_LIT>': '<STR_LIT>'})<EOL>payload = {'<STR_LIT>': vnic_data}<EOL>data = (event_type, payload)<EOL>return data<EOL>
Prepare the message to be sent to Event queue for VDP trigger.

        This is actually called for a subnet add to a router. This function
        prepares a VM's VNIC create/delete message.