Revision 05f1ebf3 daemons/ganeti-confd
b/daemons/ganeti-confd | ||
---|---|---|
192 | 192 |
check, to verify that the reload hasn't failed. |
193 | 193 |
|
194 | 194 |
""" |
195 |
def __init__(self, reader, mainloop):
|
|
195 |
def __init__(self, processor, mainloop):
|
|
196 | 196 |
"""Constructor for ConfdConfigurationReloader |
197 | 197 |
|
198 |
@type reader: L{ssconf.SimpleConfigReader}
|
|
199 |
@param reader: ganeti-confd SimpleConfigReader
|
|
198 |
@type processor: L{confd.server.ConfdProcessor}
|
|
199 |
@param processor: ganeti-confd ConfdProcessor
|
|
200 | 200 |
@type mainloop: L{daemon.Mainloop} |
201 | 201 |
@param mainloop: ganeti-confd mainloop |
202 | 202 |
|
203 | 203 |
""" |
204 |
self.reader = reader
|
|
204 |
self.processor = processor
|
|
205 | 205 |
self.mainloop = mainloop |
206 | 206 |
|
207 | 207 |
self.polling = False |
... | ... | |
239 | 239 |
raise errors.ConfdFatalError(err) |
240 | 240 |
|
241 | 241 |
try: |
242 |
reloaded = self.reader.Reload() |
|
242 |
reloaded = self.processor.reader.Reload()
|
|
243 | 243 |
if reloaded: |
244 | 244 |
logging.info("Reloaded ganeti config") |
245 | 245 |
else: |
... | ... | |
275 | 275 |
""" |
276 | 276 |
self.timer_handle = None |
277 | 277 |
try: |
278 |
reloaded = self.reader.Reload() |
|
278 |
reloaded = self.processor.reader.Reload()
|
|
279 | 279 |
except errors.ConfigurationError: |
280 | 280 |
# transform a ConfigurationError in a fatal error, that will cause confd |
281 | 281 |
# to quit. |
... | ... | |
320 | 320 |
""" |
321 | 321 |
mainloop = daemon.Mainloop() |
322 | 322 |
|
323 |
# confd-level SimpleConfigReader |
|
324 |
reader = ssconf.SimpleConfigReader() |
|
325 |
|
|
326 | 323 |
# Asyncronous confd UDP server |
327 |
processor = ConfdProcessor(reader)
|
|
324 |
processor = ConfdProcessor() |
|
328 | 325 |
server = ConfdAsyncUDPServer(options.bind_address, options.port, processor) |
329 | 326 |
|
330 | 327 |
# Configuration reloader |
331 |
reloader = ConfdConfigurationReloader(reader, mainloop)
|
|
328 |
reloader = ConfdConfigurationReloader(processor, mainloop)
|
|
332 | 329 |
|
333 | 330 |
mainloop.Run() |
334 | 331 |
|
Also available in: Unified diff