The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/69
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) === Add ability to query the host config. Signed-off-by: Chuck Short <chuck.sh...@canonical.com>
From 9d1c93ccc2d4389e06ac9d759e89b3281eed0975 Mon Sep 17 00:00:00 2001 From: Chuck Short <chuck.sh...@canonical.com> Date: Sun, 6 Mar 2016 20:31:04 -0500 Subject: [PATCH] Add host config API call Add ability to query the host config. Signed-off-by: Chuck Short <chuck.sh...@canonical.com> --- pylxd/deprecated/api.py | 3 +++ pylxd/deprecated/hosts.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/pylxd/deprecated/api.py b/pylxd/deprecated/api.py index 18660d4..a051284 100644 --- a/pylxd/deprecated/api.py +++ b/pylxd/deprecated/api.py @@ -71,6 +71,9 @@ def get_kernel_version(self, data=None): def get_host_certificate(self): return self.hosts.get_certificate() + def host_config(self): + return self.hosts.host_config() + # images def image_list(self): return self.image.image_list() diff --git a/pylxd/deprecated/hosts.py b/pylxd/deprecated/hosts.py index 2ea757f..7044515 100644 --- a/pylxd/deprecated/hosts.py +++ b/pylxd/deprecated/hosts.py @@ -116,3 +116,11 @@ def get_certificate(self): return data['environment']['certificate'] except exceptions.PyLXDException as e: print('Handling run-time error: {}'.format(e)) + + def host_config(self): + try: + (state, data) = self.connection.get_object('GET', '/1.0') + return data.get('metadata') + except exceptions.PyLXDException as e: + print('Handling run-time error: {}'.format(e)) +
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel