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

Error in Alerta class tabular #138

Closed
albertomusetti opened this issue Aug 24, 2018 · 5 comments
Closed

Error in Alerta class tabular #138

albertomusetti opened this issue Aug 24, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@albertomusetti
Copy link

In Alerta CLI 5.2.0, I get an error in alerta.tabular method.

Looking at the code (https://github.com/alerta/python-alerta-client/blob/master/alertaclient/models/alert.py#L156) I don't understand why there calling #'history': [h.serialize(timezone) for h in self.history] instead of 'history': [h for h in self.history]

@satterly
Copy link
Member

What's the command you are running and what's the exact error? Can you paste the error below? Thanks.

@satterly satterly added the bug Something isn't working label Aug 24, 2018
@albertomusetti
Copy link
Author

This is the snippet code:

    client = Client(endpoint='http://127.0.0.1:8080/api', key='demo-admin-key')
    try:
        id, alert, message = client.send_alert(
            environment='Production',
            resource='123',
            **msg
        )
        alert_msg = alert.tabular(timezone='UTC')

    except Exception as e:
        print(e)

The Error is: 'dict' object has no attribute 'serialize'

Thanks for your support.

@satterly
Copy link
Member

ok. I'll see if I can reproduce. this sort of thing (I hope) can be avoided when alerta starts making use of python3 typing. just for my info though, are you using python 2 or python 3?

@albertomusetti
Copy link
Author

Python version = 3.6.5
Alerta CLI = 5.2.0

Thanks.

@satterly
Copy link
Member

Thanks for reporting this. It should now be fixed and available as version 5.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants