<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 30, 2016 at 5:33 PM, Barak Korren <span dir="ltr"><<a href="mailto:bkorren@redhat.com" target="_blank">bkorren@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><p dir="ltr"><span class=""><br>
><br>
><br>
> Keeping the IP fixed should be an option, not mandatory.<br>
> The reason I need it is that I have an input file that needs the IP addresses of the hosts I'm running. <br>
> Theoretically it should have supported host names, practically, it doesn't seem to work well with it :(<br>
> Y.<br>
><br></span>
Maybe we can live-generate the file from the lago status output?</p>
</blockquote></div><br></div><div class="gmail_extra">Indeed...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><ugly-hack-not-tested-yet></div><div class="gmail_extra"><div class="gmail_extra">with open('../<a href="http://robo.conf.in">robo.conf.in</a>') as f:</div><div class="gmail_extra"> robo_conf_in = f.read()</div><div class="gmail_extra"><br></div><div class="gmail_extra"> replacements = {</div><div class="gmail_extra"> '@HOST0@': prefix.virt_env.get_vm(_get_prefixed_name('host0').ip(),</div><div class="gmail_extra"> '@HOST1@': prefix.virt_env.get_vm(_get_prefixed_name('host1').ip(),</div><div class="gmail_extra"> '@HOST2@': prefix.virt_env.get_vm(_get_prefixed_name('host2').ip(),</div><div class="gmail_extra"> }</div><div class="gmail_extra"> for k, v in replacements.items():</div><div class="gmail_extra"> robo_conf_out = robo_conf_in.replace(k, v, 1)</div><div class="gmail_extra"><br></div><div class="gmail_extra"> with open('../robo.conf', 'w') as out:</div><div class="gmail_extra"> out.write(robo_conf_out)</div><div class="gmail_extra"> out.close()</div><div><br></div><div></ugly-hack-not-tested-yet></div></div></div>