'Create interface.'

def create_interface(self, ifname, description, admin_state, mode, l2sub):

    if l2sub:
        self.updates_cmd.append(('interface    %s    mode    l2' % ifname))
    else:
        self.updates_cmd.append(('interface    %s' % ifname))
    if (not description):
        description = ''
    else:
        self.updates_cmd.append(('description    %s' % description))
    if l2sub:
        xmlstr = (CE_NC_XML_CREATE_INTF_L2SUB % (ifname, description))
    else:
        xmlstr = (CE_NC_XML_CREATE_INTF % (ifname, description))
    if (admin_state and is_admin_state_enable(self.intf_type)):
        xmlstr += (CE_NC_XML_MERGE_INTF_STATUS % (ifname, admin_state))
        if (admin_state == 'up'):
            self.updates_cmd.append('undo    shutdown')
        else:
            self.updates_cmd.append('shutdown')
    if (mode and is_portswitch_enalbe(self.intf_type)):
        if (mode == 'layer2'):
            xmlstr += (CE_NC_XML_MERGE_INTF_L2ENABLE % (ifname, 'enable'))
            self.updates_cmd.append('portswitch')
        elif (mode == 'layer3'):
            xmlstr += (CE_NC_XML_MERGE_INTF_L2ENABLE % (ifname, 'disable'))
            self.updates_cmd.append('undo    portswitch')
    conf_str = (('<config>    ' + xmlstr) + '    </config>')
    recv_xml = set_nc_config(self.module, conf_str)
    self.check_response(recv_xml, 'CREATE_INTF')
    self.changed = True
