[Kimchi-devel] [PATCH] [WoK 6/9] Removing old /plugins API

dhbarboza82 at gmail.com dhbarboza82 at gmail.com
Fri Jan 20 12:15:41 UTC 2017


From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>

This API was behaving as a SimpleCollection but with the
newer model from the new /config/plugins API. It makes
little sense to keep it like that.

Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
---
 docs/API/plugins.md        | 13 -------------
 src/wok/control/plugins.py | 29 -----------------------------
 tests/test_api.py          |  4 ++++
 3 files changed, 4 insertions(+), 42 deletions(-)
 delete mode 100644 docs/API/plugins.md
 delete mode 100644 src/wok/control/plugins.py

diff --git a/docs/API/plugins.md b/docs/API/plugins.md
deleted file mode 100644
index aaa37b5..0000000
--- a/docs/API/plugins.md
+++ /dev/null
@@ -1,13 +0,0 @@
-## REST API Specification for Plugins
-
-### Collection: Plugins
-
-**URI:** /plugins
-
-**Methods:**
-
-* **GET**: Retrieve a summarized list names of all UI Plugins
-
-#### Examples
-GET /plugins
-[pluginA, pluginB, pluginC]
diff --git a/src/wok/control/plugins.py b/src/wok/control/plugins.py
deleted file mode 100644
index 57dfa1b..0000000
--- a/src/wok/control/plugins.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Project Wok
-#
-# Copyright IBM Corp, 2015-2016
-#
-# Code derived from Project Kimchi
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
-
-from wok.control.base import SimpleCollection
-from wok.control.utils import UrlSubNode
-
-
- at UrlSubNode("plugins")
-class Plugins(SimpleCollection):
-    def __init__(self, model):
-        super(Plugins, self).__init__(model)
diff --git a/tests/test_api.py b/tests/test_api.py
index 1358151..127e94a 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -94,6 +94,10 @@ class APITests(unittest.TestCase):
             plugin = plugins[0]
             self.assertEqual(plugin.get('enabled'), False)
 
+    def test_plugins_api_404(self):
+        resp = self.request('/plugins')
+        self.assertEquals(404, resp.status)
+
     def test_user_log(self):
         # Login and logout to make sure there there are entries in user log
         hdrs = {'AUTHORIZATION': '',
-- 
2.7.4



More information about the Kimchi-devel mailing list