<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Andriy, (meanwhile) you can help yourself with (doing that
sequentially)..<br>
<br>
<tt>for container in `lxc list mysql-rep --format=json | jq
.[].name | tr -d '"'`; do lxc exec $container -- apt update;
done</tt><br>
</p>
<p>-Ingo</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 10.11.2016 um 15:36 schrieb Andriy
Tovstik:<br>
</div>
<blockquote
cite="mid:CABqniEYyUDOvXEx=6UWMA5H67=SoJsFBmhcAjw_zchmzX0Og4g@mail.gmail.com"
type="cite">
<div dir="ltr">Thanks, Stéphane, i'm very inattentive... Now it
looks better. Additional output format seems to be more
comfortable than additional tools. But it insignificantly.
<div><br>
</div>
<div>And what do you think about the second question about
ability to run commands on multiplie containers simultaneously
using regexps as container name ? Is this feature looks
useful?</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div class="gmail_quote">
<div dir="ltr">чт, 10 нояб. 2016 г. в 15:25, Stéphane Graber
<<a moz-do-not-send="true"
href="mailto:stgraber@ubuntu.com">stgraber@ubuntu.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">stgraber@castiana:~$
lxc list --format=json | jq .[].name<br class="gmail_msg">
"android"<br class="gmail_msg">
"lxd"<br class="gmail_msg">
"snapcraft"<br class="gmail_msg">
"test"<br class="gmail_msg">
"ubuntu-core"<br class="gmail_msg">
"ubuntu-zesty"<br class="gmail_msg">
"xen"<br class="gmail_msg">
"yak"<br class="gmail_msg">
<br class="gmail_msg">
On Thu, Nov 10, 2016 at 12:31:01PM +0000, Andriy Tovstik
wrote:<br class="gmail_msg">
> Hi, Janjaap Bos!<br class="gmail_msg">
><br class="gmail_msg">
> I tried jq. But as i have already wrote, some useful
fileds like container<br class="gmail_msg">
> name are missing in json output...<br
class="gmail_msg">
><br class="gmail_msg">
> чт, 10 нояб. 2016 г. в 14:27, Janjaap Bos <<a
moz-do-not-send="true"
href="mailto:janjaapbos@gmail.com" class="gmail_msg"
target="_blank">janjaapbos@gmail.com</a>>:<br
class="gmail_msg">
><br class="gmail_msg">
> > You can pipe the json through jq.<br
class="gmail_msg">
> ><br class="gmail_msg">
> > See: <a moz-do-not-send="true"
href="https://stedolan.github.io/jq/tutorial"
rel="noreferrer" class="gmail_msg" target="_blank">https://stedolan.github.io/jq/tutorial</a><br
class="gmail_msg">
> ><br class="gmail_msg">
> ><br class="gmail_msg">
> > 2016-11-10 11:17 GMT+01:00 Andriy Tovstik <<a
moz-do-not-send="true"
href="mailto:andriy.tovstik@gmail.com" class="gmail_msg"
target="_blank">andriy.tovstik@gmail.com</a>>:<br
class="gmail_msg">
> ><br class="gmail_msg">
> > Hi all!<br class="gmail_msg">
> ><br class="gmail_msg">
> > During LXD learning i encountered with lack of
some features.<br class="gmail_msg">
> ><br class="gmail_msg">
> > The first one is "raw" output format of lxc
list. Currently lxc list<br class="gmail_msg">
> > supports two formats: table and json.
Unfortunately both formats are<br class="gmail_msg">
> > unusable for scripting.<br class="gmail_msg">
> > It is very difficult to pass to script output
likes:<br class="gmail_msg">
> > # lxc list --format table -c n<br
class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | NAME |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep1 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep2 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> > | mysql-rep3 |<br class="gmail_msg">
> > +------------+<br class="gmail_msg">
> ><br class="gmail_msg">
> > When i try to use json format i see that useful
fields like container name<br class="gmail_msg">
> > are missing in output. May be it will be useful
to implement feature like:<br class="gmail_msg">
> ><br class="gmail_msg">
> > # lxc list --format raw -c n --no-header<br
class="gmail_msg">
> > mysql-rep1<br class="gmail_msg">
> > mysql-rep2<br class="gmail_msg">
> > mysql-rep3<br class="gmail_msg">
> ><br class="gmail_msg">
> > The second feature looks useful is ability run
commands on multiplie<br class="gmail_msg">
> > containers simultaneously. For example:<br
class="gmail_msg">
> ><br class="gmail_msg">
> > # lxc exec web-node* -- apt update<br
class="gmail_msg">
> ><br class="gmail_msg">
> > What do you think about it?<br class="gmail_msg">
> > --<br class="gmail_msg">
> > WBR, Andriy Tovstik<br class="gmail_msg">
> ><br class="gmail_msg">
> > _______________________________________________<br
class="gmail_msg">
> > lxc-users mailing list<br class="gmail_msg">
> > <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
> ><br class="gmail_msg">
> ><br class="gmail_msg">
> > _______________________________________________<br
class="gmail_msg">
> > lxc-users mailing list<br class="gmail_msg">
> > <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> > <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
><br class="gmail_msg">
> --<br class="gmail_msg">
> WBR, Andriy Tovstik<br class="gmail_msg">
<br class="gmail_msg">
> _______________________________________________<br
class="gmail_msg">
> lxc-users mailing list<br class="gmail_msg">
> <a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
> <a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br
class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Stéphane Graber<br class="gmail_msg">
Ubuntu developer<br class="gmail_msg">
<a moz-do-not-send="true" href="http://www.ubuntu.com"
rel="noreferrer" class="gmail_msg" target="_blank">http://www.ubuntu.com</a><br
class="gmail_msg">
_______________________________________________<br
class="gmail_msg">
lxc-users mailing list<br class="gmail_msg">
<a moz-do-not-send="true"
href="mailto:lxc-users@lists.linuxcontainers.org"
class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br
class="gmail_msg">
<a moz-do-not-send="true"
href="http://lists.linuxcontainers.org/listinfo/lxc-users"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote>
</div>
</div>
</div>
<div dir="ltr">-- <br>
</div>
<div data-smartmail="gmail_signature">
<div dir="ltr">WBR, Andriy Tovstik</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br>
</body>
</html>