Return a client object for accessing consul

def get_conn(profile):
    '''
    Return a client object for accessing consul
    '''
    params = {}
    for key in ('host', 'port', 'token', 'scheme', 'consistency', 'dc', 'verify'):
        if key in profile:
            params[key] = profile[key]

    if HAS_CONSUL:
        return consul.Consul(**params)
    else:
        raise CommandExecutionError(
            '(unable to import consul, '
            'module most likely not installed. PLease install python-consul)'
        )