Update offline deployment test
Change-Id: I3c935be8ad6f038ce6c25221de6d09e93619c94d
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 06e7d0b..2b06dc3 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -198,10 +198,20 @@
'password': settings.SSH_NODE_CREDENTIALS['password']
}
- return [
- host(k, next(i for i in v['ipv4'] if i in pool_net))
- for k, v in hosts.items()
- if next(i for i in v['ipv4'] if i in pool_net)]
+ try:
+ ret = [
+ host(k, next(i for i in v['ipv4'] if i in pool_net))
+ for k, v in hosts.items()
+ if next(i for i in v['ipv4'] if i in pool_net)]
+ LOG.debug("Fetched ssh data from salt grains - {}".format(ret))
+ return ret
+ except StopIteration:
+ msg = ("Can't match nodes ip address with network cidr\n"
+ "Managment network - {net}\n"
+ "Host with address - {host_list}".format(
+ net=pool_net,
+ host_list={k: v['ipv4'] for k, v in hosts.items()}))
+ raise StopIteration(msg)
def service_status(self, tgt, service):
result = self.local(tgt=tgt, fun='service.status', args=service)