ginjo / slackspace

Slack integration for Rackspace notifications
7 stars 1 forks source link

Breaks when entity has no IP address #1

Open mp459 opened 8 years ago

mp459 commented 8 years ago

Thanks for putting this together. it's great! It doesn break with a nil error when there is no IP address though. I've changed the code for entity_ip_address to:

    if (webhook['entity']['ip_addresses'].nil?)
          entity_ip_address="not available"
      else
          entity_ip_address = webhook['entity']['ip_addresses']['default']
      end

this should fix it :)

ginjo commented 8 years ago

Cool, thanks - and glad to hear someone is using this! I'll work that fix into the code when I get a chance.

I'm curious: Are you running your own instance of this, or are you using the hosted demo at Heroku?

When I wrote this, I had high hopes of turning it into a general webhook translation/forwarding service, with a set of preconfigured translations, and the ability to add custom translations, to work between any two services (not just Slack and Rackspace). I'd still like to do that, but I wonder if there is already something out there.

ginjo commented 8 years ago

Hey @mp459, I just updated the github repo and the heroku app with your fix for a nil IP. I also made a number of other small fixes and enhancements. Thanks again for the contrib.