Skip to content

Commit

Permalink
Don't try to use the topology output plugin if none is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
monicasarbu committed Sep 14, 2014
1 parent a03c2db commit 6b75989
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ func (publisher *PublisherType) GetServerName(ip string) string {
}
}
// find the agent with the desired IP
return publisher.TopologyOutput.GetNameByIP(ip)
if publisher.TopologyOutput != nil {
return publisher.TopologyOutput.GetNameByIP(ip)
} else {
return ""
}
}

func (publisher *PublisherType) PublishHttpTransaction(t *HttpTransaction) error {
Expand Down Expand Up @@ -261,11 +265,13 @@ func (publisher *PublisherType) PublishTopology(params ...string) error {
localAddrs = addrs
}

DEBUG("publish", "Add topology entry for %s: %s", publisher.name, localAddrs)
if publisher.TopologyOutput != nil {
DEBUG("publish", "Add topology entry for %s: %s", publisher.name, localAddrs)

err := publisher.TopologyOutput.PublishIPs(publisher.name, localAddrs)
if err != nil {
return err
err := publisher.TopologyOutput.PublishIPs(publisher.name, localAddrs)
if err != nil {
return err
}
}

return nil
Expand Down

0 comments on commit 6b75989

Please sign in to comment.