Vendor and update lxc-to-lxd script #11

Merged
merged 2 commits into from Aug 7, 2017

Conversation

Projects
None yet
2 participants
Member

axw commented Aug 7, 2017

We vendor the lxc-to-lxd script as at lxc/lxd@dde9507, and update the script locally to ignore the following config:

  • lxc.tty
  • lxc.devttydir
  • lxc.pivotdir
  • lxc.hook.clone

The first two should be irrelevant for cloud-based
software, and aren't supported by LXD anyway.

The lxc.pivotdir config is ignored by LXC now, and
is not important.

The lxc.hook.clone config is used by the Ubuntu
Cloud image templates for LXC, and is irrelevant
because we don't clone LXD containers in Juju 2.x.

axw added some commits Aug 4, 2017

Updates to lxc-to-lxd script
We update the script to ignore the following config:
 - lxc.tty
 - lxc.devttydir
 - lxc.pivotdir
 - lxc.hook.clone

The first two should be irrelevant for cloud-based
software, and aren't supported by LXD anyway.

The lxc.pivotdir config is ignored by LXC now, and
is not important.

The lxc.hook.clone config is used by the Ubuntu
Cloud image templates for LXC, and is irrelevant
because we don't clone LXD containers in Juju 2.x.

Looks good to me!

@@ -18,8 +18,8 @@ except ImportError:
# is strictly only true for 'lxc.aa_profile'.
keys_to_check = [
'lxc.pts',
- # 'lxc.tty',
- # 'lxc.devttydir',
+ 'lxc.tty',
@babbageclunk

babbageclunk Aug 7, 2017

Member

You're including them in the list to ignore them - is this a whitelist? And so they're ignored because they're allowed in the config but we don't do anything with them, is that right?

@@ -225,7 +225,7 @@ def convert_container(lxd_socket, container_name, args):
# Load the container
try:
container = lxc.Container(container_name, args.lxcpath)
- except:
+ except Exception:
@babbageclunk

babbageclunk Aug 7, 2017

Member

Aren't these basically equivalent? I guess this avoids catching SystemExit.

@axw

axw Aug 7, 2017

Member

this was an upstream change in lxc-to-lxd, just shows up here because of the "go generate"

@axw axw merged commit 66bbdac into juju:master Aug 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment