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

Slack publisher misnamed hook_url causes error in 1.0.4 #21

Open
chris-skud opened this issue Sep 6, 2016 · 3 comments
Open

Slack publisher misnamed hook_url causes error in 1.0.4 #21

chris-skud opened this issue Sep 6, 2016 · 3 comments

Comments

@chris-skud
Copy link

chris-skud commented Sep 6, 2016

With the addition of internal logging, the Slack Publisher throws the following error:

Traceback (most recent call last):
  File "run_suite.py", line 66, in <module>
    test()
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "run_suite.py", line 50, in test
    alarmageddon.run_tests(validations, publishers)
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/alarmageddon/run.py", line 89, in run_tests
    timeout, timeout_retries)
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/alarmageddon/run.py", line 151, in _run_validations
    reporter.report()
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/alarmageddon/reporter.py", line 48, in report
    logger.debug("Reporting to {}".format(publisher))
  File "/var/lib/jenkins/jobs/utx-system-monitors-production/workspace/.venv/local/lib/python2.7/site-packages/alarmageddon/publishing/slack.py", line 61, in __str__
    return "Slack: {}".format(self.hook_url)
AttributeError: 'SlackPublisher' object has no attribute 'hook_url'

I believe hook_url needs a leading underscore here: https://github.com/PearsonEducation/Alarmageddon/blob/dev/alarmageddon/publishing/slack.py#L61

@curtisallen
Copy link
Contributor

Seeing this with the release 1.0.4

@scotthellman
Copy link
Contributor

Sorry about that! We don't use Slack here so we're relying purely on unit tests to make sure it works. Guess we have some more tests to write 😃

Looks straightforward enough, but I want to write those new tests and make sure this problem isn't lurking in any other classes. I'll try to get a fix pushed up tomorrow - in the meantime 1.0.3 should work as long as you aren't trying to convert your SlackPublisher to a string anywhere.

@scotthellman
Copy link
Contributor

Ok, this should be fixed as of f10aabf in the dev branch. Could yall try pulling down dev and making sure it's working for you? Once you've confirmed that it is, I'll push out a new pypi release.

(you can pull down the dev branch with pip using: pip install git+https://github.com/PearsonEducation/Alarmageddon.git@dev#egg=alarmageddon )

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

3 participants