'Returns the UID of the tenant specified by the hierarchical name.
(ex tenant1/tenant2/tenant3)'

def tenant_query(self, label):

    if common.is_uri(label):
        return label
    tenant_id = self.tenant_getid()
    if (not label):
        return tenant_id
    subtenants = self.tenant_list(tenant_id)
    subtenants.append(self.tenant_show(None))
    for tenant in subtenants:
        if (tenant['name'] == label):
            rslt = self.tenant_show_by_uri(tenant['id'])
            if rslt:
                return tenant['id']
    raise common.CoprHdError(common.CoprHdError.NOT_FOUND_ERR, (_('Tenant    %s:    not    found') % label))
