Skip to content

StaticResolver contains list #270

Closed
Closed
@fwrite

Description

@fwrite

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions