diff --git a/setup.py b/setup.py index 8061fda..b333f08 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,6 @@ 'docopt >= 0.6.1', 'pyvmomi >= 5.5.0', 'tabulate >= 0.7.2', - 'vconnector >= 0.2.0', + 'vconnector >= 0.2.9', ] ) diff --git a/src/vpoller-cclient/vpoller-cclient.c b/src/vpoller-cclient/vpoller-cclient.c index 0aaaffe..bab2778 100644 --- a/src/vpoller-cclient/vpoller-cclient.c +++ b/src/vpoller-cclient/vpoller-cclient.c @@ -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); diff --git a/src/vpoller/worker.py b/src/vpoller/worker.py index 599c1b1..849f179 100644 --- a/src/vpoller/worker.py +++ b/src/vpoller/worker.py @@ -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 @@ -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