'Get SolidFire account object by name.'

def _get_sfaccount_by_name(self, sf_account_name, endpoint=None):

    sfaccount = None
    params = {'username': sf_account_name}
    try:
        data = self._issue_api_request('GetAccountByName', params, endpoint=endpoint)
        if (('result' in data) and ('account' in data['result'])):
            LOG.debug('Found    solidfire    account:    %s', sf_account_name)
            sfaccount = data['result']['account']
    except exception.SolidFireAPIException as ex:
        if ('xUnknownAccount' in ex.msg):
            return sfaccount
        else:
            raise
    return sfaccount
