Return a dict of all available VM locations on the cloud provider with
    relevant data

def list_keypairs(call=None):
    '''
    Return a dict of all available VM locations on the cloud provider with
    relevant data
    '''
    if call != 'function':
        log.error(
            'The list_keypairs function must be called with -f or --function.'
        )
        return False

    fetch = True
    page = 1
    ret = {}

    while fetch:
        items = query(method='account/keys', command='?page=' + six.text_type(page) +
                      '&per_page=100')

        for key_pair in items['ssh_keys']:
            name = key_pair['name']
            if name in ret:
                raise SaltCloudSystemExit(
                    'A duplicate key pair name, \'{0}\', was found in DigitalOcean\'s '
                    'key pair list. Please change the key name stored by DigitalOcean. '
                    'Be sure to adjust the value of \'ssh_key_file\' in your cloud '
                    'profile or provider configuration, if necessary.'.format(
                        name
                    )
                )
            ret[name] = {}
            for item in six.iterkeys(key_pair):
                ret[name][item] = six.text_type(key_pair[item])

        page += 1
        try:
            fetch = 'next' in items['links']['pages']
        except KeyError:
            fetch = False

    return ret