[lxc-devel] [lxc/lxc] c223a5: Fix environment before importing setuptools

2016-10-25 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: c223a53622d25f8753aa4c48313441dce512ec40
  https://github.com/lxc/lxc/commit/c223a53622d25f8753aa4c48313441dce512ec40
  Author: Stéphane Graber 
  Date:   2016-10-25 (Tue, 25 Oct 2016)

  Changed paths:
M src/python-lxc/setup.py

  Log Message:
  ---
  Fix environment before importing setuptools

Signed-off-by: Stéphane Graber 


  Commit: ca1faa6822628d8bf805b04b8339e174e9656687
  https://github.com/lxc/lxc/commit/ca1faa6822628d8bf805b04b8339e174e9656687
  Author: Christian Brauner 
  Date:   2016-10-26 (Wed, 26 Oct 2016)

  Changed paths:
M src/python-lxc/setup.py

  Log Message:
  ---
  Merge pull request #1252 from stgraber/master

Fix environment before importing setuptools


Compare: https://github.com/lxc/lxc/compare/ac94fda679b7...ca1faa682262___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/master] Fix environment before importing setuptools

2016-10-25 Thread stgraber on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1252

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber 
From c223a53622d25f8753aa4c48313441dce512ec40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= 
Date: Tue, 25 Oct 2016 19:08:34 -0400
Subject: [PATCH] Fix environment before importing setuptools
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber 
---
 src/python-lxc/setup.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/python-lxc/setup.py b/src/python-lxc/setup.py
index 39e16c4..bf0d74a 100644
--- a/src/python-lxc/setup.py
+++ b/src/python-lxc/setup.py
@@ -25,10 +25,7 @@
 import os
 import subprocess
 
-from setuptools import setup, Extension
-from setuptools.command.build_ext import build_ext as BuildExtCommand
-
-# Fix build when PIE is enabled
+# Fix build when PIE is enabled (must run before setuptools import)
 for var in ("LDFLAGS", "CFLAGS"):
 current = os.environ.get(var, None)
 if not current:
@@ -44,6 +41,9 @@
 
 os.environ[var] = " ".join(new)
 
+from setuptools import setup, Extension
+from setuptools.command.build_ext import build_ext as BuildExtCommand
+
 
 class LxcBuildExtCommand(BuildExtCommand):
 user_options = BuildExtCommand.user_options + [
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [pylxd/master] Remove the need for a mock-services branch

2016-10-25 Thread rockstar on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/195

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
What it says on the tin
From e8b0590ba01ed8ad6eaec843a94f249901964b54 Mon Sep 17 00:00:00 2001
From: Paul Hummer 
Date: Tue, 25 Oct 2016 15:33:05 -0600
Subject: [PATCH] Remove the need for a mock-services branch test

---
 test-requirements.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/test-requirements.txt b/test-requirements.txt
index 0c5e340..ae59d0c 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,5 +3,4 @@ nose>=1.3.7
 mock>=1.3.0
 flake8>=2.5.0
 coverage>=4.1
-# See https://github.com/novafloss/mock-services/pull/15
--e 
git://github.com/rockstar/mock-services.git@aba3977d1a3f43afd77d99f241eec20deeed#egg=mock-services
+mock-services>=0.3
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/lxc] f4790f: Tweak libtool handling to work with Android

2016-10-25 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: f4790f1f612df18f3b933de3de52e3f0bfbc0fde
  https://github.com/lxc/lxc/commit/f4790f1f612df18f3b933de3de52e3f0bfbc0fde
  Author: Stéphane Graber 
  Date:   2016-10-25 (Tue, 25 Oct 2016)

  Changed paths:
M src/lxc/Makefile.am

  Log Message:
  ---
  Tweak libtool handling to work with Android

Signed-off-by: Stéphane Graber 


  Commit: ac94fda679b754f3bd47e31e8d94b28eda0d4963
  https://github.com/lxc/lxc/commit/ac94fda679b754f3bd47e31e8d94b28eda0d4963
  Author: Christian Brauner 
  Date:   2016-10-25 (Tue, 25 Oct 2016)

  Changed paths:
M src/lxc/Makefile.am

  Log Message:
  ---
  Merge pull request #1251 from stgraber/master

Tweak libtool handling to work with Android


Compare: https://github.com/lxc/lxc/compare/7d1937d093c2...ac94fda679b7___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [pylxd/master] Fully deprecate the old api

2016-10-25 Thread rockstar on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/194

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
At this point, we should deprecate the code so far as to see that
anywhere it's being used has "pylxd.deprecated" in the import. I
think this makes sense for nova-lxd, but also for any code still
using the old API.
From 7376f57dc29cb0ff0405ae48fc5397f4f9e1655a Mon Sep 17 00:00:00 2001
From: Paul Hummer 
Date: Tue, 25 Oct 2016 15:25:22 -0600
Subject: [PATCH] Fully deprecate the old api

At this point, we should deprecate the code so far as to see that
anywhere it's being used has "pylxd.deprecated" in the import. I
think this makes sense for nova-lxd, but also for any code still
using the old API.
---
 pylxd/__init__.py  | 1 -
 pylxd/deprecated/tests/__init__.py | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/pylxd/__init__.py b/pylxd/__init__.py
index 6fac57e..76cef15 100644
--- a/pylxd/__init__.py
+++ b/pylxd/__init__.py
@@ -16,5 +16,4 @@
 
 __version__ = pbr.version.VersionInfo('pylxd').version_string()
 
-from pylxd.deprecated import api  # NOQA
 from pylxd.client import Client  # NOQA
diff --git a/pylxd/deprecated/tests/__init__.py 
b/pylxd/deprecated/tests/__init__.py
index 4780a2b..17a2aaa 100644
--- a/pylxd/deprecated/tests/__init__.py
+++ b/pylxd/deprecated/tests/__init__.py
@@ -16,7 +16,7 @@
 from ddt import unpack
 import unittest
 
-from pylxd import api
+from pylxd.deprecated import api
 
 
 class LXDAPITestBase(unittest.TestCase):
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxd/master] Fix random path stuff

2016-10-25 Thread tych0 on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2559

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===

From 6f0d82f7209a5ce4cd533d1dc4c2d7574d8a717a Mon Sep 17 00:00:00 2001
From: Tycho Andersen 
Date: Tue, 25 Oct 2016 15:00:43 -0600
Subject: [PATCH 1/2] client: fix mkdir -p /

Signed-off-by: Tycho Andersen 
---
 client.go | 5 +
 1 file changed, 5 insertions(+)

diff --git a/client.go b/client.go
index 4309cb6..49fa8e3 100644
--- a/client.go
+++ b/client.go
@@ -1836,6 +1836,11 @@ func (c *Client) MkdirP(container string, p string, mode 
os.FileMode) error {
return fmt.Errorf("This function isn't supported by public 
remotes.")
}
 
+   /* special case, every container has a /, we don't need to do anything 
*/
+   if p == "/" {
+   return nil
+   }
+
parts := strings.Split(p, "/")
i := len(parts)
 

From 570d4de1803a125f4b818404374730660b71ae06 Mon Sep 17 00:00:00 2001
From: Tycho Andersen 
Date: Tue, 25 Oct 2016 15:02:11 -0600
Subject: [PATCH 2/2] lxc file: normalize paths before sending them to the
 server

Note that we don't need to normalize the path on file pull, becuase LXD
will tell us whether it's a file or directory.

Closes #2557

Signed-off-by: Tycho Andersen 
---
 lxc/file.go  | 11 +++
 test/suites/filemanip.sh |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/lxc/file.go b/lxc/file.go
index cd00d55..f610f5f 100644
--- a/lxc/file.go
+++ b/lxc/file.go
@@ -74,6 +74,17 @@ func (c *fileCmd) push(config *lxd.Config, send_file_perms 
bool, args []string)
return fmt.Errorf(i18n.G("Invalid target %s"), target)
}
 
+   /* Fix up the path. Let's:
+* 1. re-add the leading / that got stripped from the SplitN
+* 2. clean it and remove any /./, /../, /, etc.
+* 3. keep the trailing slash if it had one, since we use it via
+*filepath.Split below
+*/
+   pathSpec[1] = filepath.Clean("/" + pathSpec[1])
+   if target[len(target)-1] == '/' {
+   pathSpec[1] = pathSpec[1] + "/"
+   }
+
targetPath := pathSpec[1]
remote, container := config.ParseRemoteAndContainer(pathSpec[0])
 
diff --git a/test/suites/filemanip.sh b/test/suites/filemanip.sh
index d59d08c..64503a6 100644
--- a/test/suites/filemanip.sh
+++ b/test/suites/filemanip.sh
@@ -40,5 +40,8 @@ test_filemanip() {
   lxc file pull filemanip/tmp/this/is/a/nonexistent/directory/foo "${TEST_DIR}"
   [ "$(cat "${TEST_DIR}"/foo)" = "foo" ]
 
+  lxc file push -p "${TEST_DIR}"/source/foo filemanip/.
+  [ "$(lxc exec filemanip cat /foo)" = "foo" ]
+
   lxc delete filemanip -f
 }
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/master] Tweak libtool handling to work with Android

2016-10-25 Thread stgraber on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1251

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber 
From f4790f1f612df18f3b933de3de52e3f0bfbc0fde Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= 
Date: Tue, 25 Oct 2016 16:39:56 -0400
Subject: [PATCH] Tweak libtool handling to work with Android
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber 
---
 src/lxc/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index 8138a56..6bcb6da 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -298,8 +298,8 @@ endif
 install-exec-local: install-libLTLIBRARIES
mkdir -p $(DESTDIR)$(datadir)/lxc
install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
-   rm $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
-   mv $(DESTDIR)$(libdir)/liblxc.so.1.0.0 
$(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
+   mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) 
$(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
+   rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1
cd $(DESTDIR)$(libdir); \
ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., 
,@LXC_ABI@)); \
ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxd/master] Don't destroy ephemeral container on restart

2016-10-25 Thread stgraber on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2558

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Closes #2555

Signed-off-by: Stéphane Graber 
From 3fa287c5a35b73eaf3c623cdc164e744d27047d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= 
Date: Tue, 25 Oct 2016 15:24:12 -0400
Subject: [PATCH] Don't destroy ephemeral container on restart
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #2555

Signed-off-by: Stéphane Graber 
---
 lxd/container_state.go | 24 
 1 file changed, 24 insertions(+)

diff --git a/lxd/container_state.go b/lxd/container_state.go
index 2b73320..c01cefc 100644
--- a/lxd/container_state.go
+++ b/lxd/container_state.go
@@ -109,6 +109,30 @@ func containerStatePut(d *Daemon, r *http.Request) 
Response {
}
case shared.Restart:
do = func(op *operation) error {
+   ephemeral := c.IsEphemeral()
+
+   if ephemeral {
+   // Unset ephemeral flag
+   args := containerArgs{
+   Architecture: c.Architecture(),
+   Config:   c.LocalConfig(),
+   Devices:  c.LocalDevices(),
+   Ephemeral:false,
+   Profiles: c.Profiles(),
+   }
+
+   err := c.Update(args, false)
+   if err != nil {
+   return err
+   }
+
+   // On function return, set the flag back on
+   defer func() {
+   args.Ephemeral = ephemeral
+   c.Update(args, true)
+   }()
+   }
+
if raw.Timeout == 0 || raw.Force {
err = c.Stop(false)
if err != nil {
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/lxc] 0f90d6: c/r: use --external instead of --veth-pair

2016-10-25 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 0f90d613ab0d473731e6207a651685467f30c817
  https://github.com/lxc/lxc/commit/0f90d613ab0d473731e6207a651685467f30c817
  Author: Tycho Andersen 
  Date:   2016-10-24 (Mon, 24 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  c/r: use --external instead of --veth-pair

--veth-pair has been deprecated as of 2.6, let's use the new --external
instead.

Signed-off-by: Tycho Andersen 


  Commit: 2f3fbc6bf3c41942ea8fe13ba29cc040096981a8
  https://github.com/lxc/lxc/commit/2f3fbc6bf3c41942ea8fe13ba29cc040096981a8
  Author: Tycho Andersen 
  Date:   2016-10-24 (Mon, 24 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  c/r: remember to increment netnr

We need this for calculating the name of unnamed interfaces in the config.
But we also need to remember to increment it :)

Signed-off-by: Tycho Andersen 


  Commit: e269733002642e2f5faa6aab59d3181558a74898
  https://github.com/lxc/lxc/commit/e269733002642e2f5faa6aab59d3181558a74898
  Author: Tycho Andersen 
  Date:   2016-10-24 (Mon, 24 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  c/r: add checkpoint/restore support for macvlan interfaces

Signed-off-by: Tycho Andersen 


  Commit: f0b458e1054c632b085abfa8f59285c1ca8ba746
  https://github.com/lxc/lxc/commit/f0b458e1054c632b085abfa8f59285c1ca8ba746
  Author: Tycho Andersen 
  Date:   2016-10-24 (Mon, 24 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  c/r: drop duplicate hunk from macvlan case

Signed-off-by: Tycho Andersen 


  Commit: 796a109dbe9d5d406fe724cf542b4b8b1a0d6a76
  https://github.com/lxc/lxc/commit/796a109dbe9d5d406fe724cf542b4b8b1a0d6a76
  Author: Tycho Andersen 
  Date:   2016-10-24 (Mon, 24 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  c/r: use snprintf to compute device name

This will never actually overflow, because %d is 32 bits and eth is 128
bytes long, but safety first :)

Signed-off-by: Tycho Andersen 


  Commit: 7d1937d093c2409a440d6927a2a0ad6c4b7c1053
  https://github.com/lxc/lxc/commit/7d1937d093c2409a440d6927a2a0ad6c4b7c1053
  Author: Christian Brauner 
  Date:   2016-10-25 (Tue, 25 Oct 2016)

  Changed paths:
M src/lxc/criu.c

  Log Message:
  ---
  Merge pull request #1248 from tych0/use-external

c/r: use external


Compare: https://github.com/lxc/lxc/compare/00afe6d90cf2...7d1937d093c2___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel