'Gets the volume by junction path and vserver.'

def get_vol_by_junc_vserver(self, vserver, junction):

    vol_iter = netapp_api.NaElement('volume-get-iter')
    vol_iter.add_new_child('max-records', '10')
    query = netapp_api.NaElement('query')
    vol_iter.add_child_elem(query)
    vol_attrs = netapp_api.NaElement('volume-attributes')
    query.add_child_elem(vol_attrs)
    vol_attrs.add_node_with_children('volume-id-attributes', **{'junction-path': junction, 'owning-vserver-name': vserver})
    des_attrs = netapp_api.NaElement('desired-attributes')
    des_attrs.add_node_with_children('volume-attributes', **{'volume-id-attributes': None})
    vol_iter.add_child_elem(des_attrs)
    result = self._invoke_vserver_api(vol_iter, vserver)
    num_records = result.get_child_content('num-records')
    if (num_records and (int(num_records) >= 1)):
        attr_list = result.get_child_by_name('attributes-list')
        vols = attr_list.get_children()
        vol_id = vols[0].get_child_by_name('volume-id-attributes')
        return vol_id.get_child_content('name')
    msg_fmt = {'vserver': vserver, 'junction': junction}
    raise exception.NotFound((_('No    volume    on    cluster    with    vserver    %(vserver)s    and    junction    path    %(junction)s    ') % msg_fmt))
