The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/102

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) ===
Currently its not possible to  specify devices when creating a
LXD profile. This is required so we can attach
disks, network interfaces, etc in nova-lxd

Signed-off-by: Chuck Short <chuck.sh...@canonical.com>
From bf24df46d21da59d4dd7537de3cb2a6225d3f63b Mon Sep 17 00:00:00 2001
From: Chuck Short <chuck.sh...@canonical.com>
Date: Tue, 24 May 2016 21:50:33 -0400
Subject: [PATCH] Allow specification of devices in a profile

Currently its not specify devices when creating a
LXD profile. This is required so we can attach
disks, network interfaces, etc.

Signed-off-by: Chuck Short <chuck.sh...@canonical.com>
---
 pylxd/profile.py            | 5 +++--
 pylxd/tests/test_profile.py | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pylxd/profile.py b/pylxd/profile.py
index 1dab086..16c7de4 100644
--- a/pylxd/profile.py
+++ b/pylxd/profile.py
@@ -44,11 +44,12 @@ def all(cls, client):
         return profiles
 
     @classmethod
-    def create(cls, client, name, config):
+    def create(cls, client, name, config, devices={}):
         """Create a profile."""
         client.api.profiles.post(json={
             'name': name,
-            'config': config
+            'config': config,
+            'devices': devices
             })
 
         return cls.get(client, name)
diff --git a/pylxd/tests/test_profile.py b/pylxd/tests/test_profile.py
index f8ea7e1..49df682 100644
--- a/pylxd/tests/test_profile.py
+++ b/pylxd/tests/test_profile.py
@@ -14,7 +14,7 @@ def test_all(self):
     def test_create(self):
         """A new profile is created."""
         an_profile = profile.Profile.create(
-            self.client, name='an-new-profile', config={})
+            self.client, name='an-new-profile', config={}, devices={})
 
         self.assertIsInstance(an_profile, profile.Profile)
         self.assertEqual('an-new-profile', an_profile.name)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to