Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcobra1973 committed Aug 28, 2014
2 parents 6371871 + f0be46e commit 5619f68
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
'docopt >= 0.6.1',
'pyvmomi >= 5.5.0',
'tabulate >= 0.7.2',
'vconnector >= 0.2.0',
'vconnector >= 0.2.9',
]
)
1 change: 1 addition & 0 deletions src/vpoller-cclient/vpoller-cclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ main(int argc, char *argv[])

/* Do we have any result? */
if (result == NULL) {
rc = EX_UNAVAILABLE;
printf("{ \"success\": 1, \"msg\": \"Did not receive reply from server, aborting...\" }\n");
} else {
printf("%s\n", result);
Expand Down
31 changes: 0 additions & 31 deletions src/vpoller/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,9 @@ def run(self, config):
# Spawn the vSphere Agents of the Worker
self.spawn_vsphere_agents()

# Start the vSphere Agents
self.start_vsphere_agents()

# Enter the main daemon loop from here
logging.debug('Entering main daemon loop')
while not self.time_to_die:
# Keep our vSphere Agents alive
self.keep_agents_alive()

socks = dict(self.zpoller.poll(1000))

# Worker socket, receives client messages for processing
Expand Down Expand Up @@ -224,33 +218,8 @@ def spawn_vsphere_agents(self):
pwd=each_agent['pwd'],
host=each_agent['host']
)
agent.last_keep_alive_heartbeat = time()
self.agents[agent.host] = agent

def start_vsphere_agents(self):
"""
Connects all vSphere Agents to their respective VMware vSphere hosts
"""
logging.debug('Starting vSphere Agents')

for agent in self.agents:
self.agents[agent].connect()

def keep_agents_alive(self):
"""
Dummy method to keep our vSphere Agents alive
This dummy method calls CurrentTime() vSphere method
periodically (every 60 seconds) in order to keep the vSphere Agents alive
"""
for each_agent in self.agents:
if (time() - self.agents[each_agent].last_keep_alive_heartbeat) > 60.0:
logging.debug('[%s] Agent keep-alive heartbeat', self.agents[each_agent].host)
self.agents[each_agent].si.CurrentTime()
self.agents[each_agent].last_keep_alive_heartbeat = time()

def shutdown_vsphere_agents(self):
"""
Disconnects all vPoller Agents from their respective VMware vSphere hosts
Expand Down

0 comments on commit 5619f68

Please sign in to comment.