[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-devel
Subject:    [lxc-devel] [pylxd/master] Remove `Profile.rename` code; add a test
From:       rockstar on Github <lxc-bot () linuxcontainers ! org>
Date:       2016-05-29 5:29:53
Message-ID: 20160529052953.A2AC234C48 () mailman01 ! srv ! dcmtl ! stgraber ! net
[Download RAW message or body]

[Attachment #2 (text/x-mailbox)]

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

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) ===


[Attachment #3 (text/plain)]

From 2744ab828502321ce119f3f471f35725b572fd62 Mon Sep 17 00:00:00 2001
From: Paul Hummer <paul@eventuallyanyway.com>
Date: Sat, 28 May 2016 23:30:14 -0600
Subject: [PATCH] Remove `Profile.rename` code; add a test

---
 pylxd/profile.py            | 2 --
 pylxd/tests/test_profile.py | 7 +++++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pylxd/profile.py b/pylxd/profile.py
index ede9c17..fbcc902 100644
--- a/pylxd/profile.py
+++ b/pylxd/profile.py
@@ -75,8 +75,6 @@ def rename(self, new):
         """Rename the profile."""
         raise NotImplementedError(
             'LXD does not currently support renaming profiles')
-        self._client.api.profiles[self.name].post(json={'name': new})
-        self.name = new
 
     def delete(self):
         """Delete a profile."""
diff --git a/pylxd/tests/test_profile.py b/pylxd/tests/test_profile.py
index 689e5e4..a3a5b98 100644
--- a/pylxd/tests/test_profile.py
+++ b/pylxd/tests/test_profile.py
@@ -46,6 +46,13 @@ def test_create(self):
         self.assertIsInstance(an_profile, profile.Profile)
         self.assertEqual('an-new-profile', an_profile.name)
 
+    def test_rename(self):
+        """Profiles cannot yet be renamed."""
+        an_profile = profile.Profile.get(self.client, 'an-profile')
+
+        self.assertRaises(
+            NotImplementedError, an_profile.rename, 'an-renamed-profile')
+
     def test_create_failed(self):
         """CreateFailed is raised when errors occur."""
         def error(request, context):

[Attachment #4 (text/plain)]

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic