Skip to content

Commit

Permalink
Start the vSphere Agents only if requested to do so
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 3, 2013
1 parent 49d343f commit ca766b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/vmpollerd/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ class VMPollerWorker(Daemon):
run() method
"""
def run(self, config_file):
def run(self, config_file, start_agents=False):
"""
The main worker loop.
Args:
config_file (str): Configuration file for the VMPollerWorker
config_file (str): Configuration file for the VMPollerWorker
run_agents (bool): If True then all vSphere Agents will be started up upfront
any polling has occurred. Otherwise, a vSphere Agent will be
started only if needed.
Raises:
VMPollerException
Expand Down Expand Up @@ -166,8 +169,8 @@ def run(self, config_file):
agent = VMPollerWorkerAgent(eachConf, ignore_locks=True, lockdir="/var/run/vm-pollerd", keep_alive=True)
self.agents[agent.vcenter] = agent

# Time to fire up our vSphere poller Agents
self.start_agents()
if start_agents:
self.start_agents()

# A management socket, used to control the VMPoller daemon
self.mgmt = self.zcontext.socket(zmq.REP)
Expand Down

0 comments on commit ca766b1

Please sign in to comment.