'Gets the list of LUNs on filer.
Gets the LUNs from cluster with vserver.'

def get_lun_list(self):

    luns = []
    tag = None
    while True:
        api = netapp_api.NaElement('lun-get-iter')
        api.add_new_child('max-records', '100')
        if tag:
            api.add_new_child('tag', tag, True)
        lun_info = netapp_api.NaElement('lun-info')
        lun_info.add_new_child('vserver', self.vserver)
        query = netapp_api.NaElement('query')
        query.add_child_elem(lun_info)
        api.add_child_elem(query)
        result = self.connection.invoke_successfully(api, True)
        if (result.get_child_by_name('num-records') and (int(result.get_child_content('num-records')) >= 1)):
            attr_list = result.get_child_by_name('attributes-list')
            luns.extend(attr_list.get_children())
        tag = result.get_child_content('next-tag')
        if (tag is None):
            break
    return luns
