Gracefully handle missing stacklight configuration
Change-Id: Ia369ce26ccff4c7f1cfeaab0634cec3e5391f081
This commit is contained in:
parent
d9c0b5f106
commit
2a265e4fea
@ -53,4 +53,5 @@ port: 8082
|
|||||||
|
|
||||||
#ip_address: 172.16.170.184
|
#ip_address: 172.16.170.184
|
||||||
#port: 8088
|
#port: 8088
|
||||||
|
#timeout: 1.0
|
||||||
|
|
||||||
|
@ -31,11 +31,20 @@ class BroadViewPublisher(BroadViewPublisherBase):
|
|||||||
try:
|
try:
|
||||||
bvcfg = ConfigParser.ConfigParser()
|
bvcfg = ConfigParser.ConfigParser()
|
||||||
bvcfg.read("/etc/broadviewcollector.conf")
|
bvcfg.read("/etc/broadviewcollector.conf")
|
||||||
self._ipaddr = bvcfg.get("stacklight", "ip_address")
|
try:
|
||||||
self._port = bvcfg.get("stacklight", "port")
|
self._ipaddr = bvcfg.get("stacklight", "ip_address")
|
||||||
self._timeout = bvcfg.get("stacklight", "timeout")
|
except:
|
||||||
|
LOG.info("BroadViewPublisher: unable to read stacklight ip_address")
|
||||||
|
try:
|
||||||
|
self._port = bvcfg.get("stacklight", "port")
|
||||||
|
except:
|
||||||
|
LOG.info("BroadViewPublisher: unable to read stacklight port")
|
||||||
|
try:
|
||||||
|
self._timeout = bvcfg.get("stacklight", "timeout")
|
||||||
|
except:
|
||||||
|
LOG.info("BroadViewPublisher: unable to read stacklight timeout")
|
||||||
except:
|
except:
|
||||||
LOG.error("BroadViewPublisher: unable to read configuration")
|
LOG.error("BroadViewPublisher: unable to read stacklight configuration")
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.readConfig()
|
self.readConfig()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user