Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StaticResolver contains list #270

Closed
fwrite opened this issue Jul 10, 2020 · 1 comment
Closed

StaticResolver contains list #270

fwrite opened this issue Jul 10, 2020 · 1 comment

Comments

@fwrite
Copy link

fwrite commented Jul 10, 2020

A fixed site id resulted in an AttributeError: 'list' object has no attribute 'get' exception.
The parameters:

python3 import_logs.py --url 'https://matomo-url.example' --token-auth 8d... --idsite 20 --log-format-name=ncsa_extended --show-progress --debug --debug-tracker /tmp/access.log.1

Reason:
The variable site in StaticResolver is a list of length 1, instead of a dictionary.

if site.get('result') == 'error':

Quick 'n dirty fix:
Add site = site[0] before.

Less quick, still a bit dirty:

        if len(site) > 1:
            fatal_error(
                "cannot find unique site with this id"
            )
        elif len(site) < 1:
            fatal_error(
                "did not find a site with siteid {:s}".format(self.site_id)
            )
        else:
            site = site[0]
@fwrite
Copy link
Author

fwrite commented Jul 10, 2020

This appears to be a duplicate of #268.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant