diff --git a/lago/plugins/vm.py b/lago/plugins/vm.py index 6a27a0a0..be498308 100644 --- a/lago/plugins/vm.py +++ b/lago/plugins/vm.py @@ -479,10 +479,21 @@ def all_ips(self): for net in nets.values(): mapping = net.mapping() for hostname, ip in mapping.items(): - if hostname.startswith(self.name()): + # hostname is - + if hostname.startswith(self.name() + "-"): ips.append(str(ip)) return ips + def ips_in_net(self, net_name): + ips = [] + net = self.virt_env.get_net(name=net_name) + mapping = net.mapping() + for hostname, ip in mapping.items(): + # hostname is - + if hostname.startswith(self.name() + "-"): + ips.append(str(ip)) + return ips + def ssh( self, command,