def get_vlan_from_associate_reply(self, reply, vsiid, mac):
try:<EOL><INDENT>verify_flag, fail_reason = self.crosscheck_reply_vsiid_mac(<EOL>reply, vsiid, mac)<EOL>if not verify_flag:<EOL><INDENT>return constants.INVALID_VLAN, fail_reason<EOL><DEDENT>mode_str = reply.partition("<STR_LIT>")[<NUM_LIT:2>].split()[<NUM_LIT:0>]<EOL>if mode_str != "<STR_LIT>":<EOL><INDENT>fail_reason = self.get_vdp_failure_reason(reply)<EOL>return constants.INVALID_VLAN, fail_reason<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>fail_reason = vdp_const.mode_failure_reason % (reply)<EOL>LOG.error("<STR_LIT:%s>", fail_reason)<EOL>return constants.INVALID_VLAN, fail_reason<EOL><DEDENT>check_filter, fail_reason = self.check_filter_validity(<EOL>reply, "<STR_LIT>")<EOL>if not check_filter:<EOL><INDENT>return constants.INVALID_VLAN, fail_reason<EOL><DEDENT>try:<EOL><INDENT>vlan_val = reply.partition("<STR_LIT>")[<NUM_LIT:2>].split('<STR_LIT:->')[<NUM_LIT:0>]<EOL>vlan = int(vlan_val)<EOL><DEDENT>except ValueError:<EOL><INDENT>fail_reason = vdp_const.format_failure_reason % (reply)<EOL>LOG.error("<STR_LIT:%s>", fail_reason)<EOL>return constants.INVALID_VLAN, fail_reason<EOL><DEDENT>return vlan, None<EOL>
Parse the associate reply from VDP daemon to get the VLAN value.