def _add_interface_trust_cmds(self, if_type, if_id, interface, trust, current_trust):
    (current_rewrite_pcp, current_rewrite_dscp, ignored1, ignored2, ignored3) = self._get_current_rewrite_config(interface)
    if ((trust == 'L3') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_DSCP, current_rewrite_dscp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))
    elif ((trust == 'L2') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_PCP, current_rewrite_pcp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))
    elif ((trust == 'both') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_DSCP, current_rewrite_dscp)
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_PCP, current_rewrite_pcp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))
def _add_interface_trust_cmds(self, if_type, if_id, interface, trust, current_trust):
    (current_rewrite_pcp, current_rewrite_dscp, ignored1, ignored2, ignored3) = self._get_current_rewrite_config(interface)
    if ((trust == 'L3') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_DSCP, current_rewrite_dscp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))
    elif ((trust == 'L2') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_PCP, current_rewrite_pcp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))
    elif ((trust == 'both') and (trust != current_trust)):
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_DSCP, current_rewrite_dscp)
        self._add_no_rewrite_cmd(if_type, if_id, interface, self.REWRITE_PCP, current_rewrite_pcp)
        self._commands.append(self.TRUST_CMD.format(if_type, if_id, trust))