<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">&lt;<a href="mailto:bkorren@redhat.com" target="_blank">bkorren@redhat.com</a>&gt;</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>
&gt;<br>
&gt;<br>
&gt; Keeping the IP fixed should be an option, not mandatory.<br>
&gt; The reason I need it is that I have an input file that needs the IP addresses of the hosts I&#39;m running. <br>
&gt; Theoretically it should have  supported host names, practically, it doesn&#39;t seem to work well with it :(<br>
&gt; Y.<br>
&gt;<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">&lt;ugly-hack-not-tested-yet&gt;</div><div class="gmail_extra"><div class="gmail_extra">with open(&#39;../<a href="http://robo.conf.in">robo.conf.in</a>&#39;) 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">        &#39;@HOST0@&#39;: prefix.virt_env.get_vm(_get_prefixed_name(&#39;host0&#39;).ip(),</div><div class="gmail_extra">        &#39;@HOST1@&#39;: prefix.virt_env.get_vm(_get_prefixed_name(&#39;host1&#39;).ip(),</div><div class="gmail_extra">        &#39;@HOST2@&#39;: prefix.virt_env.get_vm(_get_prefixed_name(&#39;host2&#39;).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(&#39;../robo.conf&#39;, &#39;w&#39;) as out:</div><div class="gmail_extra">        out.write(robo_conf_out)</div><div class="gmail_extra">        out.close()</div><div><br></div><div>&lt;/ugly-hack-not-tested-yet&gt;</div></div></div>