[Kimchi-devel] [PATCH 01/17] Ginger Base : Taking off the host tab functionality from kimchi

chandra at linux.vnet.ibm.com chandra at linux.vnet.ibm.com
Tue Sep 1 17:53:21 UTC 2015


From: chandrureddy <chandra at linux.vnet.ibm.com>

---
 plugins/kimchi/API.json                    | 134 ------------
 plugins/kimchi/Makefile.am                 |   3 +-
 plugins/kimchi/config.py.in                |   4 -
 plugins/kimchi/control/host.py             |  96 ---------
 plugins/kimchi/docs/README.md              |   6 +-
 plugins/kimchi/i18n.py                     |  50 -----
 plugins/kimchi/kimchi.conf                 |   7 -
 plugins/kimchi/mockmodel.py                |  21 --
 plugins/kimchi/model/config.py             |  21 --
 plugins/kimchi/model/host.py               | 320 -----------------------------
 plugins/kimchi/root.py                     |   1 -
 plugins/kimchi/tests/test_authorization.py |   6 -
 plugins/kimchi/tests/test_config.py.in     |   8 -
 plugins/kimchi/tests/test_model.py         | 237 ---------------------
 plugins/kimchi/tests/test_rest.py          |  47 -----
 plugins/kimchi/ui/config/tab-ext.xml       |   7 -
 plugins/kimchi/ui/js/src/kimchi.api.js     | 250 ----------------------
 plugins/kimchi/ui/pages/i18n.json.tmpl     |  43 ----
 18 files changed, 4 insertions(+), 1257 deletions(-)

diff --git a/plugins/kimchi/API.json b/plugins/kimchi/API.json
index f1f58ff..e75b35f 100644
--- a/plugins/kimchi/API.json
+++ b/plugins/kimchi/API.json
@@ -59,30 +59,6 @@
         }
     },
     "properties": {
-        "debugreports_create": {
-            "type": "object",
-            "error": "KCHDR0006E",
-            "properties": {
-                "name": {
-                    "description": "The name for the debug report file.",
-                    "type": "string",
-                    "pattern": "^[_A-Za-z0-9-]*$",
-                    "error": "KCHDR0007E"
-                }
-            }
-        },
-        "debugreport_update": {
-            "type": "object",
-            "properties": {
-                "name": {
-                    "description": "New name of debug report",
-                    "type": "string",
-                    "pattern": "^[_A-Za-z0-9-]*$",
-                    "error": "KCHDR0007E"
-                }
-            },
-            "additionalProperties": false
-        },
         "storagepools_create": {
             "type": "object",
             "error": "KCHPOOL0026E",
@@ -684,116 +660,6 @@
             "additionalProperties": false,
             "error": "KCHAPI0001E"
         },
-        "repositories_create": {
-            "type": "object",
-            "properties": {
-                "repo_id": {
-                    "description": "Repository ID used for YUM repository.",
-                    "type": "string",
-                    "error": "KCHREPOS0001E"
-                },
-                "baseurl": {
-                    "description": "URL to the directory where the repodata directory of a repository is located. Can be an http://, ftp:// or file://  URL.",
-                    "type": "string",
-                    "error": "KCHREPOS0002E"
-                },
-                "config": {
-                    "description": "Dictionary containing repository configuration",
-                    "type": "object",
-                    "error": "KCHREPOS0003E",
-                    "properties": {
-                        "dist": {
-                            "description": "Distribution to DEB repository",
-                            "type": "string",
-                            "error": "KCHREPOS0004E"
-                        },
-                        "comps": {
-                            "description": "List of components to DEB repository",
-                            "type": "array",
-                            "error": "KCHREPOS0005E",
-                            "uniqueItems": true,
-                            "items": {
-                                "description": "Component name",
-                                "type": "string",
-                                "error": "KCHREPOS0006E"
-                            }
-                        },
-                        "repo_name": {
-                            "description": "YUM repository name",
-                            "type": "string",
-                            "error": "KCHREPOS0023E"
-                        },
-                        "mirrorlist": {
-                            "description": "URL to a file containing a list of baseurls",
-                            "type": "string",
-                            "error": "KCHREPOS0007E"
-                        },
-                        "metalink": {
-                            "description": "URL to a metalink file for the repomd.xml",
-                            "type": "string",
-                            "error": "KCHREPOS0029E"
-                        }
-                    }
-                }
-            },
-            "additionalProperties": false,
-            "error": "KCHAPI0001E"
-        },
-        "repository_update": {
-            "type": "object",
-            "properties": {
-                "baseurl": {
-                    "description": "URL to the directory where the repodata directory of a repository is located. Can be an http://, ftp:// or file://  URL.",
-                    "type": "string",
-                    "error": "KCHREPOS0002E"
-                },
-                "config": {
-                    "description": "Dictionary containing repository configuration",
-                    "type": "object",
-                    "error": "KCHREPOS0003E",
-                    "properties": {
-                        "dist": {
-                            "description": "Distribution to DEB repository",
-                            "type": "string",
-                            "error": "KCHREPOS0004E"
-                        },
-                        "comps": {
-                            "description": "List of components to DEB repository",
-                            "type": "array",
-                            "error": "KCHREPOS0005E",
-                            "uniqueItems": true,
-                            "items": {
-                                "description": "Component name",
-                                "type": "string",
-                                "error": "KCHREPOS0006E"
-                            }
-                        },
-                        "repo_name": {
-                            "description": "Human-readable string describing the YUM repository.",
-                            "type": "string",
-                            "error": "KCHREPOS0008E"
-                        },
-                        "mirrorlist": {
-                            "description": "URL to a file containing a list of baseurls for YUM repository",
-                            "type": "string",
-                            "error": "KCHREPOS0007E"
-                        },
-                        "gpgcheck": {
-                            "description": "Indicates if a GPG signature check on the packages gotten from repository should be performed.",
-                            "type": "boolean",
-                            "error": "KCHREPOS0009E"
-                        },
-                        "gpgkey": {
-                            "description": "URL pointing to the ASCII-armored GPG key file for the repository.",
-                            "type": "string",
-                            "error": "KCHREPOS0010E"
-                        }
-                    }
-                }
-            },
-            "additionalProperties": false,
-            "error": "KCHAPI0001E"
-        },
         "devices_get_list": {
             "type": "object",
             "properties": {
diff --git a/plugins/kimchi/Makefile.am b/plugins/kimchi/Makefile.am
index faef341..e4a44f7 100644
--- a/plugins/kimchi/Makefile.am
+++ b/plugins/kimchi/Makefile.am
@@ -98,7 +98,6 @@ config.py: config.py.in Makefile
 
 install-deb: install
 	cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
-	mkdir -p $(DESTDIR)/var/lib/kimchi/debugreports
 	mkdir -p $(DESTDIR)/var/lib/kimchi/screenshots
 	mkdir -p $(DESTDIR)/var/lib/kimchi/isos
 
@@ -138,7 +137,7 @@ ChangeLog:
 install-data-local:
 	$(MKDIR_P) $(DESTDIR)$(kimchidir)
 	$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
-	mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,isos}
+	mkdir -p $(DESTDIR)/var/lib/kimchi/{screenshots,isos}
 
 uninstall-local:
 	$(RM) $(DESTDIR)$(kimchidir)/API.json
diff --git a/plugins/kimchi/config.py.in b/plugins/kimchi/config.py.in
index 80b72bd..5738c4d 100644
--- a/plugins/kimchi/config.py.in
+++ b/plugins/kimchi/config.py.in
@@ -38,10 +38,6 @@ def get_distros_store():
     return os.path.join(PluginPaths('kimchi').conf_dir, 'distros.d')
 
 
-def get_debugreports_path():
-    return os.path.join(PluginPaths('kimchi').state_dir, 'debugreports')
-
-
 def get_screenshot_path():
     return os.path.join(PluginPaths('kimchi').state_dir, 'screenshots')
 
diff --git a/plugins/kimchi/control/host.py b/plugins/kimchi/control/host.py
index 0a40f1b..c71c47b 100644
--- a/plugins/kimchi/control/host.py
+++ b/plugins/kimchi/control/host.py
@@ -19,7 +19,6 @@
 
 from wok.control.base import Collection, Resource, SimpleCollection
 from wok.control.utils import UrlSubNode
-from wok.exception import NotFoundError
 
 from cpuinfo import CPUInfo
 
@@ -31,14 +30,7 @@ class Host(Resource):
         self.role_key = 'host'
         self.admin_methods = ['GET', 'POST']
         self.uri_fmt = '/host/%s'
-        self.reboot = self.generate_action_handler('reboot')
-        self.shutdown = self.generate_action_handler('shutdown')
-        self.stats = HostStats(self.model)
-        self.partitions = Partitions(self.model)
         self.devices = Devices(self.model)
-        self.packagesupdate = PackagesUpdate(self.model)
-        self.repositories = Repositories(self.model)
-        self.swupdate = self.generate_action_handler_task('swupdate')
         self.cpuinfo = CPUInfo(self.model)
 
     @property
@@ -46,54 +38,6 @@ class Host(Resource):
         return self.info
 
 
-class HostStats(Resource):
-    def __init__(self, model, id=None):
-        super(HostStats, self).__init__(model, id)
-        self.role_key = 'host'
-        self.admin_methods = ['GET']
-        self.history = HostStatsHistory(self.model)
-
-    @property
-    def data(self):
-        return self.info
-
-
-class HostStatsHistory(Resource):
-    @property
-    def data(self):
-        return self.info
-
-
-class Partitions(Collection):
-    def __init__(self, model):
-        super(Partitions, self).__init__(model)
-        self.role_key = 'storage'
-        self.admin_methods = ['GET']
-        self.resource = Partition
-
-    # Defining get_resources in order to return list of partitions in UI
-    # sorted by their path
-    def _get_resources(self, flag_filter):
-        res_list = super(Partitions, self)._get_resources(flag_filter)
-        res_list = filter(lambda x: x.info['available'], res_list)
-        res_list.sort(key=lambda x: x.info['path'])
-        return res_list
-
-
-class Partition(Resource):
-    def __init__(self, model, id):
-        self.role_key = 'storage'
-        self.admin_methods = ['GET']
-        super(Partition, self).__init__(model, id)
-
-    @property
-    def data(self):
-        if not self.info['available']:
-            raise NotFoundError("KCHPART0001E", {'name': self.info['name']})
-
-        return self.info
-
-
 class Devices(Collection):
     def __init__(self, model):
         super(Devices, self).__init__(model)
@@ -115,43 +59,3 @@ class Device(Resource):
     def data(self):
         return self.info
 
-
-class PackagesUpdate(Collection):
-    def __init__(self, model):
-        super(PackagesUpdate, self).__init__(model)
-        self.role_key = 'host'
-        self.admin_methods = ['GET']
-        self.resource = PackageUpdate
-
-
-class PackageUpdate(Resource):
-    def __init__(self, model, id=None):
-        super(PackageUpdate, self).__init__(model, id)
-        self.role_key = 'host'
-        self.admin_methods = ['GET']
-
-    @property
-    def data(self):
-        return self.info
-
-
-class Repositories(Collection):
-    def __init__(self, model):
-        super(Repositories, self).__init__(model)
-        self.role_key = 'host'
-        self.admin_methods = ['GET', 'POST']
-        self.resource = Repository
-
-
-class Repository(Resource):
-    def __init__(self, model, id):
-        super(Repository, self).__init__(model, id)
-        self.role_key = 'host'
-        self.admin_methods = ['GET', 'PUT', 'POST', 'DELETE']
-        self.uri_fmt = "/host/repositories/%s"
-        self.enable = self.generate_action_handler('enable')
-        self.disable = self.generate_action_handler('disable')
-
-    @property
-    def data(self):
-        return self.info
diff --git a/plugins/kimchi/docs/README.md b/plugins/kimchi/docs/README.md
index f400333..ee6bfed 100644
--- a/plugins/kimchi/docs/README.md
+++ b/plugins/kimchi/docs/README.md
@@ -196,13 +196,13 @@ Usage
 
 Connect your browser to https://localhost:8001.  You should see a screen like:
 
-![Wok Login Screen](/docs/kimchi-login.png)
+![Wok Login Screen](docs/kimchi-login.png)
 
 Wok uses PAM to authenticate users so you can log in with the same username
 and password that you would use to log in to the machine itself.  Once logged in
 you will see a screen like:
 
-![Kimchi Guest View](/docs/kimchi-guest.png)
+![Kimchi Guest View](docs/kimchi-guest.png)
 
 This shows you the list of running guests including a live screenshot of
 the guest session.  You can use the action buttons to shutdown the guests
@@ -216,7 +216,7 @@ top navigation bar.
 
 The template screen looks like:
 
-![Kimchi Template View](/docs/kimchi-templates.png)
+![Kimchi Template View](docs/kimchi-templates.png)
 
 From this view, you can change the parameters of a template or create a
 new template using the "+" button in the upper right corner.
diff --git a/plugins/kimchi/i18n.py b/plugins/kimchi/i18n.py
index 220bd24..e9699b9 100644
--- a/plugins/kimchi/i18n.py
+++ b/plugins/kimchi/i18n.py
@@ -244,31 +244,12 @@ messages = {
     "KCHNET0021E": _("Failed to activate interface %(iface)s. Please check the physical link status."),
     "KCHNET0022E": _("Failed to start network %(name)s. Details: %(err)s"),
 
-    "KCHDR0001E": _("Debug report %(name)s does not exist"),
-    "KCHDR0002E": _("Debug report tool not found in system"),
-    "KCHDR0003E": _("Unable to create debug report %(name)s. Details: %(err)s."),
-    "KCHDR0004E": _("Can not find any debug report with the given name %(name)s"),
-    "KCHDR0005E": _("Unable to generate debug report %(name)s. Details: %(err)s"),
-    "KCHDR0006E": _("You should give a name for the debug report file."),
-    "KCHDR0007E": _("Debug report name must be a string. Only letters, digits, underscore ('_') and hyphen ('-') are allowed."),
-    "KCHDR0008E": _("The debug report with specified name \"%(name)s\" already exists. Please use another one."),
-
     "KCHSR0001E": _("Storage server %(server)s was not used by Kimchi"),
 
     "KCHDISTRO0001E": _("Distro '%(name)s' does not exist"),
 
     "KCHPART0001E": _("Partition %(name)s does not exist in the host"),
 
-    "KCHHOST0001E": _("Unable to shutdown host machine as there are running virtual machines"),
-    "KCHHOST0002E": _("Unable to reboot host machine as there are running virtual machines"),
-    "KCHHOST0003E": _("Node device '%(name)s' not found"),
-    "KCHHOST0004E": _("Conflicting flag filters specified."),
-
-    "KCHPKGUPD0001E": _("No packages marked for update"),
-    "KCHPKGUPD0002E": _("Package %(name)s is not marked to be updated."),
-    "KCHPKGUPD0003E": _("Error while getting packages marked to be updated. Details: %(err)s"),
-    "KCHPKGUPD0004E": _("There is no compatible package manager for this system."),
-
     "KCHUTILS0001E": _("Invalid URI %(uri)s"),
     "KCHUTILS0003E": _("Unable to choose a virtual machine name"),
 
@@ -288,37 +269,6 @@ messages = {
     "KCHVMSTOR0017E": _("Only one of path or pool/volume can be specified to add a new virtual machine disk"),
     "KCHVMSTOR0018E": _("Volume chosen with format %(format)s does not fit in the storage type %(type)s"),
 
-    "KCHREPOS0001E": _("YUM Repository ID must be one word only string."),
-    "KCHREPOS0002E": _("Repository URL must be an http://, ftp:// or file:// URL."),
-    "KCHREPOS0003E": _("Repository configuration is a dictionary with specific values according to repository type."),
-    "KCHREPOS0004E": _("Distribution to DEB repository must be a string"),
-    "KCHREPOS0005E": _("Components to DEB repository must be listed in a array"),
-    "KCHREPOS0006E": _("Components to DEB repository must be a string"),
-    "KCHREPOS0007E": _("Mirror list to repository must be a string"),
-    "KCHREPOS0008E": _("YUM Repository name must be string."),
-    "KCHREPOS0009E": _("GPG check must be a boolean value."),
-    "KCHREPOS0010E": _("GPG key must be a URL pointing to the ASCII-armored file."),
-    "KCHREPOS0011E": _("Could not update repository %(repo_id)s."),
-    "KCHREPOS0012E": _("Repository %(repo_id)s does not exist."),
-    "KCHREPOS0013E": _("Specify repository base URL,  mirror list or metalink in order to create or update a YUM repository."),
-    "KCHREPOS0014E": _("Repository management tool was not recognized for your system."),
-    "KCHREPOS0015E": _("Repository %(repo_id)s is already enabled."),
-    "KCHREPOS0016E": _("Repository %(repo_id)s is already disabled."),
-    "KCHREPOS0017E": _("Could not remove repository %(repo_id)s."),
-    "KCHREPOS0018E": _("Could not write repository configuration file %(repo_file)s"),
-    "KCHREPOS0019E": _("Specify repository distribution in order to create a DEB repository."),
-    "KCHREPOS0020E": _("Could not enable repository %(repo_id)s."),
-    "KCHREPOS0021E": _("Could not disable repository %(repo_id)s."),
-    "KCHREPOS0022E": _("YUM Repository ID already exists"),
-    "KCHREPOS0023E": _("YUM Repository name must be a string"),
-    "KCHREPOS0024E": _("Unable to list repositories. Details: '%(err)s'"),
-    "KCHREPOS0025E": _("Unable to retrieve repository information. Details: '%(err)s'"),
-    "KCHREPOS0026E": _("Unable to add repository. Details: '%(err)s'"),
-    "KCHREPOS0027E": _("Unable to remove repository. Details: '%(err)s'"),
-    "KCHREPOS0028E": _("Configuration items: '%(items)s' are not supported by repository manager"),
-    "KCHREPOS0029E": _("Repository metalink must be an http://, ftp:// or file:// URL."),
-    "KCHREPOS0030E": _("Cannot specify mirrorlist and metalink at the same time."),
-
     "KCHSNAP0001E": _("Virtual machine '%(vm)s' must be stopped before creating a snapshot of it."),
     "KCHSNAP0002E": _("Unable to create snapshot '%(name)s' on virtual machine '%(vm)s'. Details: %(err)s"),
     "KCHSNAP0003E": _("Snapshot '%(name)s' does not exist on virtual machine '%(vm)s'."),
diff --git a/plugins/kimchi/kimchi.conf b/plugins/kimchi/kimchi.conf
index 78f4f3f..98a6c57 100644
--- a/plugins/kimchi/kimchi.conf
+++ b/plugins/kimchi/kimchi.conf
@@ -23,13 +23,6 @@ tools.staticdir.on = True
 tools.staticdir.dir = wok.config.PluginPaths('kimchi').state_dir + '/screenshots'
 tools.nocache.on = False
 
-[/data/debugreports]
-tools.staticdir.on = True
-tools.staticdir.dir = wok.config.PluginPaths('kimchi').state_dir + '/debugreports'
-tools.nocache.on = False
-tools.wokauth.on = True
-tools.staticdir.content_types = {'xz': 'application/x-xz'}
-
 [/favicon.ico]
 tools.staticfile.on = True
 tools.staticfile.filename = wok.config.PluginPaths('kimchi').ui_dir + '/images/logo.ico'
diff --git a/plugins/kimchi/mockmodel.py b/plugins/kimchi/mockmodel.py
index e316c21..68acf6f 100644
--- a/plugins/kimchi/mockmodel.py
+++ b/plugins/kimchi/mockmodel.py
@@ -33,8 +33,6 @@ from wok.xmlutils.utils import xml_item_update
 import config
 import imageinfo
 import osinfo
-from model import cpuinfo
-from model.debugreports import DebugReportsModel
 from model.host import DeviceModel
 from model.libvirtstoragepool import IscsiPoolDef, NetfsPoolDef
 from model.libvirtstoragepool import StoragePoolDef
@@ -73,8 +71,6 @@ class MockModel(Model):
         self._mock_swupdate = MockSoftwareUpdate()
         self._mock_repositories = MockRepositories()
 
-        cpuinfo.get_topo_capabilities = \
-            MockModel.get_topo_capabilities
         libvirt.virConnect.defineXML = MockModel.domainDefineXML
         libvirt.virDomain.XMLDesc = MockModel.domainXMLDesc
         libvirt.virDomain.undefine = MockModel.undefineDomain
@@ -112,7 +108,6 @@ class MockModel(Model):
         StoragePoolModel._update_lvm_disks = self._update_lvm_disks
         StorageVolumesModel.get_list = self._mock_storagevolumes_get_list
         StorageVolumeModel.doUpload = self._mock_storagevolume_doUpload
-        DebugReportsModel._gen_debugreport_file = self._gen_debugreport_file
         LibvirtVMTemplate._get_volume_path = self._get_volume_path
         VMTemplate.get_iso_info = self._probe_image
         imageinfo.probe_image = self._probe_image
@@ -244,22 +239,6 @@ class MockModel(Model):
 
         return MockModel._libvirt_get_vol_path(pool, vol)
 
-    def _gen_debugreport_file(self, name):
-        return add_task('/plugins/kimchi/debugreports/%s' % name, self._create_log,
-                        self.objstore, name)
-
-    def _create_log(self, cb, name):
-        path = config.get_debugreports_path()
-        tmpf = os.path.join(path, name + '.tmp')
-        realf = os.path.join(path, name + '.txt')
-        length = random.randint(1000, 10000)
-        with open(tmpf, 'w') as fd:
-            while length:
-                fd.write('I am logged')
-                length = length - 1
-        os.rename(tmpf, realf)
-        cb("OK", True)
-
     def _update_lvm_disks(self, pool_name, disks):
         conn = self.conn.get()
         pool = conn.storagePoolLookupByName(pool_name.encode('utf-8'))
diff --git a/plugins/kimchi/model/config.py b/plugins/kimchi/model/config.py
index 371e382..5c984ee 100644
--- a/plugins/kimchi/model/config.py
+++ b/plugins/kimchi/model/config.py
@@ -28,10 +28,7 @@ from wok.utils import check_url_path, run_command, wok_log
 
 from ..config import find_qemu_binary
 from ..distroloader import DistroLoader
-from ..repositories import Repositories
 from ..screenshot import VMScreenshot
-from ..swupdate import SoftwareUpdate
-from debugreports import DebugReportsModel
 from featuretests import FeatureTests, FEATURETEST_POOL_NAME
 from featuretests import FEATURETEST_VM_NAME
 
@@ -116,28 +113,10 @@ class CapabilitiesModel(object):
         return False
 
     def lookup(self, *ident):
-        report_tool = DebugReportsModel.get_system_report_tool()
-        try:
-            SoftwareUpdate()
-        except Exception:
-            update_tool = False
-        else:
-            update_tool = True
-
-        try:
-            repo = Repositories()
-        except Exception:
-            repo_mngt_tool = None
-        else:
-            repo_mngt_tool = repo._pkg_mnger.TYPE
-
         return {'libvirt_stream_protocols': self.libvirt_stream_protocols,
                 'qemu_spice': self._qemu_support_spice(),
                 'qemu_stream': self.qemu_stream,
                 'screenshot': VMScreenshot.get_stream_test_result(),
-                'system_report_tool': bool(report_tool),
-                'update_tool': update_tool,
-                'repo_mngt_tool': repo_mngt_tool,
                 'federation': kconfig.get("server", "federation"),
                 'auth': kconfig.get("authentication", "method"),
                 'kernel_vfio': self.kernel_vfio,
diff --git a/plugins/kimchi/model/host.py b/plugins/kimchi/model/host.py
index 3ff034c..e24c686 100644
--- a/plugins/kimchi/model/host.py
+++ b/plugins/kimchi/model/host.py
@@ -18,27 +18,15 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import libvirt
-import os
-import platform
 import psutil
-import time
-from cherrypy.process.plugins import BackgroundTask
-from collections import defaultdict
 
-from wok import netinfo
-from wok.basemodel import Singleton
 from wok.exception import InvalidOperation, InvalidParameter
 from wok.exception import NotFoundError, OperationFailed
-from wok.utils import add_task, wok_log
 from wok.xmlutils.utils import xpath_get_text
 
 import hostdev
-from .. import disks
-from ..repositories import Repositories
-from ..swupdate import SoftwareUpdate
 from config import CapabilitiesModel
 from tasks import TaskModel
-from vms import DOM_STATE_MAP
 
 
 HOST_STATS_INTERVAL = 1
@@ -49,57 +37,6 @@ class HostModel(object):
         self.conn = kargs['conn']
         self.objstore = kargs['objstore']
         self.task = TaskModel(**kargs)
-        self.host_info = self._get_host_info()
-
-    def _get_ppc_cpu_info(self):
-        res = {}
-        with open('/proc/cpuinfo') as f:
-            for line in f.xreadlines():
-                # Parse CPU, CPU's revision and CPU's clock information
-                for key in ['cpu', 'revision', 'clock']:
-                    if key in line:
-                        info = line.split(':')[1].strip()
-                        if key == 'clock':
-                            value = float(info.split('MHz')[0].strip()) / 1000
-                        else:
-                            value = info.split('(')[0].strip()
-                        res[key] = value
-
-                        # Power machines show, for each cpu/core, a block with
-                        # all cpu information. Here we control the scan of the
-                        # necessary information (1st block provides
-                        # everything), skipping the function when find all
-                        # information.
-                        if len(res.keys()) == 3:
-                            return "%(cpu)s (%(revision)s) @ %(clock)s GHz\
-                                    " % res
-
-        return ""
-
-    def _get_host_info(self):
-        res = {}
-        if platform.machine().startswith('ppc'):
-            res['cpu_model'] = self._get_ppc_cpu_info()
-        else:
-            with open('/proc/cpuinfo') as f:
-                for line in f.xreadlines():
-                    if "model name" in line:
-                        res['cpu_model'] = line.split(':')[1].strip()
-                        break
-
-        res['cpus'] = 0
-        res['memory'] = 0L
-
-        # Include IBM PowerKVM name to supported distro names
-        _sup_distros = platform._supported_dists + ('ibm_powerkvm',)
-        # 'fedora' '17' 'Beefy Miracle'
-        distro, version, codename = platform.linux_distribution(
-            supported_dists=_sup_distros)
-        res['os_distro'] = distro
-        res['os_version'] = version
-        res['os_codename'] = unicode(codename, "utf-8")
-
-        return res
 
     def lookup(self, *name):
         cpus = psutil.NUM_CPUS
@@ -121,179 +58,6 @@ class HostModel(object):
         self.host_info['memory'] = psutil.phymem_usage().total
         return self.host_info
 
-    def swupdate(self, *name):
-        try:
-            swupdate = SoftwareUpdate()
-        except:
-            raise OperationFailed('KCHPKGUPD0004E')
-
-        pkgs = swupdate.getNumOfUpdates()
-        if pkgs == 0:
-            raise OperationFailed('KCHPKGUPD0001E')
-
-        wok_log.debug('Host is going to be updated.')
-        taskid = add_task('/plugins/kimchi/host/swupdate', swupdate.doUpdate,
-                          self.objstore, None)
-        return self.task.lookup(taskid)
-
-    def shutdown(self, args=None):
-        # Check for running vms before shutdown
-        running_vms = self._get_vms_list_by_state('running')
-        if len(running_vms) > 0:
-            raise OperationFailed("KCHHOST0001E")
-
-        wok_log.info('Host is going to shutdown.')
-        os.system('shutdown -h now')
-
-    def reboot(self, args=None):
-        # Find running VMs
-        running_vms = self._get_vms_list_by_state('running')
-        if len(running_vms) > 0:
-            raise OperationFailed("KCHHOST0002E")
-
-        wok_log.info('Host is going to reboot.')
-        os.system('reboot')
-
-    def _get_vms_list_by_state(self, state):
-        conn = self.conn.get()
-        return [dom.name().decode('utf-8')
-                for dom in conn.listAllDomains(0)
-                if (DOM_STATE_MAP[dom.info()[0]]) == state]
-
-
-class HostStatsModel(object):
-    __metaclass__ = Singleton
-
-    def __init__(self, **kargs):
-        self.host_stats = defaultdict(list)
-        self.host_stats_thread = BackgroundTask(HOST_STATS_INTERVAL,
-                                                self._update_host_stats)
-        self.host_stats_thread.start()
-
-    def lookup(self, *name):
-        return {'cpu_utilization': self.host_stats['cpu_utilization'][-1],
-                'memory': self.host_stats['memory'][-1],
-                'disk_read_rate': self.host_stats['disk_read_rate'][-1],
-                'disk_write_rate': self.host_stats['disk_write_rate'][-1],
-                'net_recv_rate': self.host_stats['net_recv_rate'][-1],
-                'net_sent_rate': self.host_stats['net_sent_rate'][-1]}
-
-    def _update_host_stats(self):
-        preTimeStamp = self.host_stats['timestamp']
-        timestamp = time.time()
-        # FIXME when we upgrade psutil, we can get uptime by psutil.uptime
-        # we get uptime by float(open("/proc/uptime").readline().split()[0])
-        # and calculate the first io_rate after the OS started.
-        with open("/proc/uptime") as time_f:
-            seconds = (timestamp - preTimeStamp if preTimeStamp else
-                       float(time_f.readline().split()[0]))
-
-        self.host_stats['timestamp'] = timestamp
-        self._get_host_disk_io_rate(seconds)
-        self._get_host_network_io_rate(seconds)
-
-        self._get_percentage_host_cpu_usage()
-        self._get_host_memory_stats()
-
-        # store only 60 stats (1 min)
-        for key, value in self.host_stats.iteritems():
-            if isinstance(value, list):
-                if len(value) == 60:
-                    self.host_stats[key] = value[10:]
-
-    def _get_percentage_host_cpu_usage(self):
-        # This is cpu usage producer. This producer will calculate the usage
-        # at an interval of HOST_STATS_INTERVAL.
-        # The psutil.cpu_percent works as non blocking.
-        # psutil.cpu_percent maintains a cpu time sample.
-        # It will update the cpu time sample when it is called.
-        # So only this producer can call psutil.cpu_percent in kimchi.
-        self.host_stats['cpu_utilization'].append(psutil.cpu_percent(None))
-
-    def _get_host_memory_stats(self):
-        virt_mem = psutil.virtual_memory()
-        # available:
-        #  the actual amount of available memory that can be given
-        #  instantly to processes that request more memory in bytes; this
-        #  is calculated by summing different memory values depending on
-        #  the platform (e.g. free + buffers + cached on Linux)
-        memory_stats = {'total': virt_mem.total,
-                        'free': virt_mem.free,
-                        'cached': virt_mem.cached,
-                        'buffers': virt_mem.buffers,
-                        'avail': virt_mem.available}
-        self.host_stats['memory'].append(memory_stats)
-
-    def _get_host_disk_io_rate(self, seconds):
-        disk_read_bytes = self.host_stats['disk_read_bytes']
-        disk_write_bytes = self.host_stats['disk_write_bytes']
-        prev_read_bytes = disk_read_bytes[-1] if disk_read_bytes else 0
-        prev_write_bytes = disk_write_bytes[-1] if disk_write_bytes else 0
-
-        disk_io = psutil.disk_io_counters(False)
-        read_bytes = disk_io.read_bytes
-        write_bytes = disk_io.write_bytes
-
-        rd_rate = int(float(read_bytes - prev_read_bytes) / seconds + 0.5)
-        wr_rate = int(float(write_bytes - prev_write_bytes) / seconds + 0.5)
-
-        self.host_stats['disk_read_rate'].append(rd_rate)
-        self.host_stats['disk_write_rate'].append(wr_rate)
-        self.host_stats['disk_read_bytes'].append(read_bytes)
-        self.host_stats['disk_write_bytes'].append(write_bytes)
-
-    def _get_host_network_io_rate(self, seconds):
-        net_recv_bytes = self.host_stats['net_recv_bytes']
-        net_sent_bytes = self.host_stats['net_sent_bytes']
-        prev_recv_bytes = net_recv_bytes[-1] if net_recv_bytes else 0
-        prev_sent_bytes = net_sent_bytes[-1] if net_sent_bytes else 0
-
-        net_ios = psutil.network_io_counters(True)
-        recv_bytes = 0
-        sent_bytes = 0
-        for key in set(netinfo.nics() +
-                       netinfo.wlans()) & set(net_ios.iterkeys()):
-            recv_bytes = recv_bytes + net_ios[key].bytes_recv
-            sent_bytes = sent_bytes + net_ios[key].bytes_sent
-
-        rx_rate = int(float(recv_bytes - prev_recv_bytes) / seconds + 0.5)
-        tx_rate = int(float(sent_bytes - prev_sent_bytes) / seconds + 0.5)
-
-        self.host_stats['net_recv_rate'].append(rx_rate)
-        self.host_stats['net_sent_rate'].append(tx_rate)
-        self.host_stats['net_recv_bytes'].append(recv_bytes)
-        self.host_stats['net_sent_bytes'].append(sent_bytes)
-
-
-class HostStatsHistoryModel(object):
-    def __init__(self, **kargs):
-        self.history = HostStatsModel(**kargs)
-
-    def lookup(self, *name):
-        return {'cpu_utilization': self.history.host_stats['cpu_utilization'],
-                'memory': self.history.host_stats['memory'],
-                'disk_read_rate': self.history.host_stats['disk_read_rate'],
-                'disk_write_rate': self.history.host_stats['disk_write_rate'],
-                'net_recv_rate': self.history.host_stats['net_recv_rate'],
-                'net_sent_rate': self.history.host_stats['net_sent_rate']}
-
-
-class PartitionsModel(object):
-    def __init__(self, **kargs):
-        pass
-
-    def get_list(self):
-        result = disks.get_partitions_names()
-        return result
-
-
-class PartitionModel(object):
-    def __init__(self, **kargs):
-        pass
-
-    def lookup(self, name):
-        return disks.get_partition_details(name)
-
 
 class DevicesModel(object):
     def __init__(self, **kargs):
@@ -390,87 +154,3 @@ class DeviceModel(object):
             raise NotFoundError('KCHHOST0003E', {'name': nodedev_name})
         return hostdev.get_dev_info(dev)
 
-
-class PackagesUpdateModel(object):
-    def __init__(self, **kargs):
-        try:
-            self.host_swupdate = SoftwareUpdate()
-        except:
-            self.host_swupdate = None
-
-    def get_list(self):
-        if self.host_swupdate is None:
-            raise OperationFailed('KCHPKGUPD0004E')
-
-        return self.host_swupdate.getUpdates()
-
-
-class PackageUpdateModel(object):
-    def __init__(self, **kargs):
-        pass
-
-    def lookup(self, name):
-        try:
-            swupdate = SoftwareUpdate()
-        except Exception:
-            raise OperationFailed('KCHPKGUPD0004E')
-
-        return swupdate.getUpdate(name)
-
-
-class RepositoriesModel(object):
-    def __init__(self, **kargs):
-        try:
-            self.host_repositories = Repositories()
-        except:
-            self.host_repositories = None
-
-    def get_list(self):
-        if self.host_repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return sorted(self.host_repositories.getRepositories())
-
-    def create(self, params):
-        if self.host_repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self.host_repositories.addRepository(params)
-
-
-class RepositoryModel(object):
-    def __init__(self, **kargs):
-        try:
-            self._repositories = Repositories()
-        except:
-            self._repositories = None
-
-    def lookup(self, repo_id):
-        if self._repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self._repositories.getRepository(repo_id)
-
-    def enable(self, repo_id):
-        if self._repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self._repositories.enableRepository(repo_id)
-
-    def disable(self, repo_id):
-        if self._repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self._repositories.disableRepository(repo_id)
-
-    def update(self, repo_id, params):
-        if self._repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self._repositories.updateRepository(repo_id, params)
-
-    def delete(self, repo_id):
-        if self._repositories is None:
-            raise InvalidOperation('KCHREPOS0014E')
-
-        return self._repositories.removeRepository(repo_id)
diff --git a/plugins/kimchi/root.py b/plugins/kimchi/root.py
index 20c41ca..1e4cab7 100644
--- a/plugins/kimchi/root.py
+++ b/plugins/kimchi/root.py
@@ -58,7 +58,6 @@ class KimchiRoot(WokRoot):
 
         make_dirs = [
             os.path.abspath(config.get_distros_store()),
-            os.path.abspath(config.get_debugreports_path()),
             os.path.abspath(config.get_screenshot_path())
         ]
         for directory in make_dirs:
diff --git a/plugins/kimchi/tests/test_authorization.py b/plugins/kimchi/tests/test_authorization.py
index 53aa847..0976622 100644
--- a/plugins/kimchi/tests/test_authorization.py
+++ b/plugins/kimchi/tests/test_authorization.py
@@ -77,12 +77,6 @@ class AuthorizationTests(unittest.TestCase):
         resp = self.request('/plugins/kimchi/host/shutdown', '{}', 'POST')
         self.assertEquals(403, resp.status)
 
-        # Non-root users can not get or debug reports
-        resp = self.request('/plugins/kimchi/debugreports', '{}', 'GET')
-        self.assertEquals(403, resp.status)
-        resp = self.request('/plugins/kimchi/debugreports', '{}', 'POST')
-        self.assertEquals(403, resp.status)
-
         # Non-root users can not create or delete network (only get)
         resp = self.request('/plugins/kimchi/networks', '{}', 'GET')
         self.assertEquals(200, resp.status)
diff --git a/plugins/kimchi/tests/test_config.py.in b/plugins/kimchi/tests/test_config.py.in
index 6bca3df..c37069f 100644
--- a/plugins/kimchi/tests/test_config.py.in
+++ b/plugins/kimchi/tests/test_config.py.in
@@ -22,7 +22,6 @@ from cherrypy.lib.reprconf import Parser
 
 from wok.config import Paths
 
-from wok.plugins.kimchi.config import get_debugreports_path
 from wok.plugins.kimchi.config import get_screenshot_path
 from wok.plugins.kimchi.config import KimchiPaths
 
@@ -167,13 +166,6 @@ class ConfigTests(unittest.TestCase):
                 'tools.staticdir.dir': get_screenshot_path(),
                 'tools.nocache.on': False
             },
-            '/data/debugreports': {
-                'tools.staticdir.on': True,
-                'tools.staticdir.dir': get_debugreports_path(),
-                'tools.nocache.on': False,
-                'tools.wokauth.on': True,
-                'tools.staticdir.content_types': {'xz': 'application/x-xz'}
-            },
             '/favicon.ico': {
                 'tools.staticfile.on': True,
                 'tools.staticfile.filename':
diff --git a/plugins/kimchi/tests/test_model.py b/plugins/kimchi/tests/test_model.py
index c70e4fb..3e95b58 100644
--- a/plugins/kimchi/tests/test_model.py
+++ b/plugins/kimchi/tests/test_model.py
@@ -943,54 +943,6 @@ class ModelTests(unittest.TestCase):
 
             self.assertTrue('kimchi-vm' in vms)
 
-    @unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
-    def test_debug_reports(self):
-        inst = model.Model('test:///default',
-                           objstore_loc=self.tmp_store)
-
-        if not inst.capabilities_lookup()['system_report_tool']:
-            raise unittest.SkipTest("Without debug report tool")
-
-        try:
-            timeout = int(os.environ['TEST_REPORT_TIMEOUT'])
-        except (ValueError, KeyError):
-            timeout = 120
-
-        namePrefix = 'unitTestReport'
-        # sosreport always deletes unsual letters like '-' and '_' in the
-        # generated report file name.
-        uuidstr = str(uuid.uuid4()).translate(None, "-_")
-        reportName = namePrefix + uuidstr
-        try:
-            inst.debugreport_delete(namePrefix + '*')
-        except NotFoundError:
-            pass
-        with RollbackContext() as rollback:
-            report_list = inst.debugreports_get_list()
-            self.assertFalse(reportName in report_list)
-            try:
-                tmp_name = reportName + "_1"
-                task = inst.debugreports_create({'name': reportName})
-                rollback.prependDefer(inst.debugreport_delete, tmp_name)
-                taskid = task['id']
-                inst.task_wait(taskid, timeout)
-                self.assertEquals('finished',
-                                  inst.task_lookup(taskid)['status'],
-                                  "It is not necessary an error.  "
-                                  "You may need to increase the "
-                                  "timeout number by "
-                                  "TEST_REPORT_TIMEOUT=200 "
-                                  "./run_tests.sh test_model")
-                report_list = inst.debugreports_get_list()
-                self.assertTrue(reportName in report_list)
-                name = inst.debugreport_update(reportName, {'name': tmp_name})
-                self.assertEquals(name, tmp_name)
-                report_list = inst.debugreports_get_list()
-                self.assertTrue(tmp_name in report_list)
-            except OperationFailed, e:
-                if 'debugreport tool not found' not in e.message:
-                    raise e
-
     def test_get_distros(self):
         inst = model.Model('test:///default',
                            objstore_loc=self.tmp_store)
@@ -1029,195 +981,6 @@ class ModelTests(unittest.TestCase):
             volumes = inst.storagevolumes_get_list(args['name'])
             self.assertEquals(len(volumes), 2)
 
-    def test_repository_create(self):
-        inst = model.Model('test:///default',
-                           objstore_loc=self.tmp_store)
-
-        yum_repos = [{'repo_id': 'fedora-fake',
-                      'baseurl': 'http://www.fedora.org'},
-                     {'repo_id': 'fedora-updates-fake',
-                      'config':
-                      {'mirrorlist': 'http://www.fedoraproject.org'}}]
-
-        deb_repos = [{'baseurl': 'http://archive.ubuntu.com/ubuntu/',
-                      'config': {'dist': 'quantal'}},
-                     {'baseurl': 'http://archive.ubuntu.com/ubuntu/',
-                      'config': {'dist': 'quantal', 'comps': ['main']}}]
-
-        yum_invalid_repos = []
-        deb_invalid_repos = []
-
-        for url in invalid_repository_urls:
-            wrong_baseurl = {'repo_id': 'wrong-id', 'baseurl': url}
-            wrong_mirrorlist = {'repo_id': 'wrong-id',
-                                'baseurl': 'www.example.com',
-                                'config': {'mirrorlist': url}}
-            wrong_config_item = {
-                'repo_id': 'wrong-id',
-                'baseurl': 'www.example.com',
-                'config': {
-                    'gpgkey': 'file:///tmp/KEY-fedora-updates-fake-19'}}
-
-            yum_invalid_repos.append(wrong_baseurl)
-            yum_invalid_repos.append(wrong_mirrorlist)
-            yum_invalid_repos.append(wrong_config_item)
-
-            wrong_baseurl['config'] = {'dist': 'tasty'}
-            wrong_config = {'baseurl': deb_repos[0]['baseurl'],
-                            'config': {
-                                'unsupported_item': "a_unsupported_item"}}
-            deb_invalid_repos.append(wrong_baseurl)
-            deb_invalid_repos.append(wrong_config)
-
-        repo_type = inst.capabilities_lookup()['repo_mngt_tool']
-        if repo_type == 'yum':
-            test_repos = yum_repos
-            invalid_repos = yum_invalid_repos
-        elif repo_type == 'deb':
-            test_repos = deb_repos
-            invalid_repos = deb_invalid_repos
-        else:
-            # repository management tool was not recognized by Kimchi
-            # skip test case
-            return
-
-        # create repositories with invalid data
-        for repo in invalid_repos:
-            self.assertRaises(InvalidParameter, inst.repositories_create, repo)
-
-        for repo in test_repos:
-            system_host_repos = len(inst.repositories_get_list())
-            repo_id = inst.repositories_create(repo)
-            host_repos = inst.repositories_get_list()
-            self.assertEquals(system_host_repos + 1, len(host_repos))
-
-            repo_info = inst.repository_lookup(repo_id)
-            self.assertEquals(repo_id, repo_info['repo_id'])
-            self.assertEquals(True, repo_info.get('enabled'))
-            self.assertEquals(repo.get('baseurl', ''),
-                              repo_info.get('baseurl'))
-
-            original_config = repo.get('config', {})
-            config_info = repo_info.get('config', {})
-
-            if repo_type == 'yum':
-                self.assertEquals(original_config.get('mirrorlist', ''),
-                                  config_info.get('mirrorlist', ''))
-                self.assertEquals(True, config_info['gpgcheck'])
-            else:
-                self.assertEquals(original_config['dist'], config_info['dist'])
-                self.assertEquals(original_config.get('comps', []),
-                                  config_info.get('comps', []))
-
-            inst.repository_delete(repo_id)
-            self.assertRaises(NotFoundError, inst.repository_lookup, repo_id)
-
-        self.assertRaises(NotFoundError, inst.repository_lookup, 'google')
-
-    def test_repository_update(self):
-        inst = model.Model('test:///default',
-                           objstore_loc=self.tmp_store)
-
-        yum_repo = {'repo_id': 'fedora-fake',
-                    'baseurl': 'http://www.fedora.org'}
-        yum_new_repo = {'baseurl': 'http://www.fedoraproject.org'}
-
-        deb_repo = {'baseurl': 'http://archive.ubuntu.com/ubuntu/',
-                    'config': {'dist': 'quantal'}}
-        deb_new_repo = {'baseurl': 'http://br.archive.canonical.com/ubuntu/',
-                        'config': {'dist': 'utopic'}}
-
-        yum_invalid_repos = []
-        deb_invalid_repos = []
-
-        for url in invalid_repository_urls:
-            wrong_baseurl = {'baseurl': url}
-            wrong_mirrorlist = {'baseurl': 'www.example.com',
-                                'config': {'mirrorlist': url}}
-
-            yum_invalid_repos.append(wrong_baseurl)
-            yum_invalid_repos.append(wrong_mirrorlist)
-
-            wrong_baseurl['config'] = {'dist': 'tasty'}
-            deb_invalid_repos.append(wrong_baseurl)
-
-        repo_type = inst.capabilities_lookup()['repo_mngt_tool']
-        if repo_type == 'yum':
-            repo = yum_repo
-            new_repo = yum_new_repo
-            invalid_repos = yum_invalid_repos
-        elif repo_type == 'deb':
-            repo = deb_repo
-            new_repo = deb_new_repo
-            invalid_repos = deb_invalid_repos
-        else:
-            # repository management tool was not recognized by Kimchi
-            # skip test case
-            return
-
-        system_host_repos = len(inst.repositories_get_list())
-
-        with RollbackContext() as rollback:
-            repo_id = inst.repositories_create(repo)
-            rollback.prependDefer(inst.repository_delete, repo_id)
-
-            host_repos = inst.repositories_get_list()
-            self.assertEquals(system_host_repos + 1, len(host_repos))
-
-            # update repositories with invalid data
-            for tmp_repo in invalid_repos:
-                self.assertRaises(InvalidParameter, inst.repository_update,
-                                  repo_id, tmp_repo)
-
-            new_repo_id = inst.repository_update(repo_id, new_repo)
-            repo_info = inst.repository_lookup(new_repo_id)
-
-            self.assertEquals(new_repo_id, repo_info['repo_id'])
-            self.assertEquals(new_repo['baseurl'], repo_info['baseurl'])
-            self.assertEquals(True, repo_info['enabled'])
-            inst.repository_update(new_repo_id, repo)
-
-    def test_repository_disable_enable(self):
-        inst = model.Model('test:///default',
-                           objstore_loc=self.tmp_store)
-
-        yum_repo = {'repo_id': 'fedora-fake',
-                    'baseurl': 'http://www.fedora.org'}
-        deb_repo = {'baseurl': 'http://archive.ubuntu.com/ubuntu/',
-                    'config': {'dist': 'quantal'}}
-
-        repo_type = inst.capabilities_lookup()['repo_mngt_tool']
-        if repo_type == 'yum':
-            repo = yum_repo
-        elif repo_type == 'deb':
-            repo = deb_repo
-        else:
-            # repository management tool was not recognized by Kimchi
-            # skip test case
-            return
-
-        system_host_repos = len(inst.repositories_get_list())
-
-        repo_id = inst.repositories_create(repo)
-
-        host_repos = inst.repositories_get_list()
-        self.assertEquals(system_host_repos + 1, len(host_repos))
-
-        repo_info = inst.repository_lookup(repo_id)
-        self.assertEquals(True, repo_info['enabled'])
-
-        inst.repository_disable(repo_id)
-        repo_info = inst.repository_lookup(repo_id)
-        self.assertEquals(False, repo_info['enabled'])
-
-        inst.repository_enable(repo_id)
-        repo_info = inst.repository_lookup(repo_id)
-        self.assertEquals(True, repo_info['enabled'])
-
-        # remove files creates
-        inst.repository_delete(repo_id)
-
-
 class BaseModelTests(unittest.TestCase):
     class FoosModel(object):
         def __init__(self):
diff --git a/plugins/kimchi/tests/test_rest.py b/plugins/kimchi/tests/test_rest.py
index 1a1ae6c..75e4342 100644
--- a/plugins/kimchi/tests/test_rest.py
+++ b/plugins/kimchi/tests/test_rest.py
@@ -1127,53 +1127,6 @@ class RestTests(unittest.TestCase):
             # Distro not found error
             self.assertIn('KCHDISTRO0001E', distro.get('reason'))
 
-    def test_debugreports(self):
-        resp = request(host, ssl_port, '/plugins/kimchi/debugreports')
-        self.assertEquals(200, resp.status)
-
-    def _report_delete(self, name):
-        request(host, ssl_port, '/plugins/kimchi/debugreports/%s' % name, '{}', 'DELETE')
-
-    def test_create_debugreport(self):
-        req = json.dumps({'name': 'report1'})
-        with RollbackContext() as rollback:
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports', req, 'POST')
-            self.assertEquals(202, resp.status)
-            task = json.loads(resp.read())
-            # make sure the debugreport doesn't exist until the
-            # the task is finished
-            wait_task(self._task_lookup, task['id'])
-            rollback.prependDefer(self._report_delete, 'report2')
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports/report1')
-            debugreport = json.loads(resp.read())
-            self.assertEquals("report1", debugreport['name'])
-            self.assertEquals(200, resp.status)
-            req = json.dumps({'name': 'report2'})
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports/report1',
-                           req, 'PUT')
-            self.assertEquals(303, resp.status)
-
-    def test_debugreport_download(self):
-        req = json.dumps({'name': 'report1'})
-        with RollbackContext() as rollback:
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports', req, 'POST')
-            self.assertEquals(202, resp.status)
-            task = json.loads(resp.read())
-            # make sure the debugreport doesn't exist until the
-            # the task is finished
-            wait_task(self._task_lookup, task['id'], 20)
-            rollback.prependDefer(self._report_delete, 'report1')
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports/report1')
-            debugreport = json.loads(resp.read())
-            self.assertEquals("report1", debugreport['name'])
-            self.assertEquals(200, resp.status)
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports/report1/content')
-            self.assertEquals(200, resp.status)
-            resp = request(host, ssl_port, '/plugins/kimchi/debugreports/report1')
-            debugre = json.loads(resp.read())
-            resp = request(host, ssl_port, debugre['uri'])
-            self.assertEquals(200, resp.status)
-
     def test_repositories(self):
         def verify_repo(t, res):
             for field in ('repo_id', 'enabled', 'baseurl', 'config'):
diff --git a/plugins/kimchi/ui/config/tab-ext.xml b/plugins/kimchi/ui/config/tab-ext.xml
index ee88c88..48ec9ec 100644
--- a/plugins/kimchi/ui/config/tab-ext.xml
+++ b/plugins/kimchi/ui/config/tab-ext.xml
@@ -2,13 +2,6 @@
 <tabs-ext>
     <tab>
         <access role="admin" mode="admin"/>
-        <access role="user" mode="none"/>
-
-        <title>Host</title>
-        <path>plugins/kimchi/host.html</path>
-    </tab>
-    <tab>
-        <access role="admin" mode="admin"/>
         <access role="user" mode="byInstance"/>
 
         <title>Guests</title>
diff --git a/plugins/kimchi/ui/js/src/kimchi.api.js b/plugins/kimchi/ui/js/src/kimchi.api.js
index 0ec3747..19fe1a6 100644
--- a/plugins/kimchi/ui/js/src/kimchi.api.js
+++ b/plugins/kimchi/ui/js/src/kimchi.api.js
@@ -70,37 +70,6 @@ var kimchi = {
     },
 
     /**
-     * Get the dynamic host stats (usually used for monitoring).
-     */
-    getHostStats : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/stats',
-            type : 'GET',
-            contentType : 'application/json',
-            headers: {'Wok-Robot': 'wok-robot'},
-            dataType : 'json',
-            success : suc,
-            error: err
-        });
-    },
-
-    /**
-     * Get the historic host stats.
-     */
-    getHostStatsHistory : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/stats/history',
-            type : 'GET',
-            resend: true,
-            contentType : 'application/json',
-            headers: {'Wok-Robot': 'wok-robot'},
-            dataType : 'json',
-            success : suc,
-            error: err
-        });
-    },
-
-    /**
      *
      * Create a new Virtual Machine. Usage: kimchi.createVM({ name: 'MyUbuntu',
      * template: '/templates/ubuntu_base' }, creationSuc, creationErr);
@@ -638,18 +607,6 @@ var kimchi = {
         });
     },
 
-    listReports : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/debugreports',
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            resend: true,
-            success : suc,
-            error : err
-        });
-    },
-
     trackTask : function(taskID, suc, err, progress) {
         var onTaskResponse = function(result) {
             var taskStatus = result['status'];
@@ -676,75 +633,6 @@ var kimchi = {
             kimchi.trackingTasks.push(taskID);
     },
 
-    createReport: function(settings, suc, err, progress) {
-        var onResponse = function(data) {
-            taskID = data['id'];
-            kimchi.trackTask(taskID, suc, err, progress);
-        };
-
-        wok.requestJSON({
-            url : 'plugins/kimchi/debugreports',
-            type : "POST",
-            contentType : "application/json",
-            data : JSON.stringify(settings),
-            dataType : "json",
-            success : onResponse,
-            error : err
-        });
-    },
-
-    renameReport : function(name, settings, suc, err) {
-        $.ajax({
-            url : "plugins/kimchi/debugreports/" + encodeURIComponent(name),
-            type : 'PUT',
-            contentType : 'application/json',
-            data : JSON.stringify(settings),
-            dataType : 'json',
-            success: suc,
-            error: err
-        });
-    },
-
-    deleteReport: function(settings, suc, err) {
-        var reportName = encodeURIComponent(settings['name']);
-        wok.requestJSON({
-            url : 'plugins/kimchi/debugreports/' + reportName,
-            type : 'DELETE',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    downloadReport: function(settings, suc, err) {
-        window.open(settings['file']);
-    },
-
-    shutdown: function(settings, suc, err) {
-        var reboot = settings && settings['reboot'] === true;
-        var url = 'plugins/kimchi/host/' + (reboot ? 'reboot' : 'shutdown');
-        wok.requestJSON({
-            url : url,
-            type : 'POST',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    listHostPartitions : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/partitions',
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
     getStorageServers: function(type, suc, err) {
         var url = 'plugins/kimchi/storageservers?_target_type=' + type;
         wok.requestJSON({
@@ -872,131 +760,6 @@ var kimchi = {
         });
     },
 
-    listSoftwareUpdates : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/packagesupdate',
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            resend: true,
-            success : suc,
-            error : err
-        });
-    },
-
-    updateSoftware : function(suc, err, progress) {
-        var taskID = -1;
-        var onResponse = function(data) {
-            taskID = data['id'];
-            trackTask();
-        };
-
-        var trackTask = function() {
-            kimchi.getTask(taskID, onTaskResponse, err);
-        };
-
-        var onTaskResponse = function(result) {
-            var taskStatus = result['status'];
-            switch(taskStatus) {
-            case 'running':
-                progress && progress(result);
-                setTimeout(function() {
-                    trackTask();
-                }, 200);
-                break;
-            case 'finished':
-            case 'failed':
-                suc(result);
-                break;
-            default:
-                break;
-            }
-        };
-
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/swupdate',
-            type : "POST",
-            contentType : "application/json",
-            dataType : "json",
-            success : onResponse,
-            error : err
-        });
-    },
-
-    createRepository : function(settings, suc, err) {
-        wok.requestJSON({
-            url : "plugins/kimchi/host/repositories",
-            type : "POST",
-            contentType : "application/json",
-            data : JSON.stringify(settings),
-            dataType : "json",
-            success: suc,
-            error: err
-        });
-    },
-
-    retrieveRepository : function(repository, suc, err) {
-        var reposID = encodeURIComponent(repository);
-        wok.requestJSON({
-            url : "plugins/kimchi/host/repositories/" + reposID,
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    updateRepository : function(name, settings, suc, err) {
-        var reposID = encodeURIComponent(name);
-        $.ajax({
-            url : "plugins/kimchi/host/repositories/" + reposID,
-            type : 'PUT',
-            contentType : 'application/json',
-            data : JSON.stringify(settings),
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    enableRepository : function(name, enable, suc, err) {
-        var reposID = encodeURIComponent(name);
-        $.ajax({
-            url : "plugins/kimchi/host/repositories/" + reposID +
-                  '/' + (enable === true ? 'enable' : 'disable'),
-            type : 'POST',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    deleteRepository : function(repository, suc, err) {
-        var reposID = encodeURIComponent(repository);
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/repositories/' + reposID,
-            type : 'DELETE',
-            contentType : 'application/json',
-            dataType : 'json',
-            success : suc,
-            error : err
-        });
-    },
-
-    listRepositories : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/repositories',
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            resend: true,
-            success : suc,
-            error : err
-        });
-    },
-
     getHostFCDevices: function(suc, err) {
         var url = 'plugins/kimchi/host/devices?_cap=fc_host';
         wok.requestJSON({
@@ -1339,17 +1102,4 @@ var kimchi = {
         });
     },
 
-    getCPUInfo : function(suc, err) {
-        wok.requestJSON({
-            url : 'plugins/kimchi/host/cpuinfo',
-            type : 'GET',
-            contentType : 'application/json',
-            dataType : 'json',
-            resend : true,
-            success : suc,
-            error : err ? err : function(data) {
-                wok.message.error(data.responseJSON.reason);
-            }
-        });
-    }
 };
diff --git a/plugins/kimchi/ui/pages/i18n.json.tmpl b/plugins/kimchi/ui/pages/i18n.json.tmpl
index cd320e0..f7f557d 100644
--- a/plugins/kimchi/ui/pages/i18n.json.tmpl
+++ b/plugins/kimchi/ui/pages/i18n.json.tmpl
@@ -75,49 +75,6 @@
     "KCHHOST6007M": "$_("Sent")",
     "KCHHOST6008M": "$_("Shutting down or restarting host will cause unsaved work lost. Continue to shut down/restarting?")",
 
-
-    "KCHREPO6001M": "$_("Confirm")",
-    "KCHREPO6002M": "$_("Repository will be removed permanently and can't be recovered. Do you want to continue?")",
-    "KCHREPO6003M": "$_("Repositories")",
-    "KCHREPO6004M": "$_("ID")",
-    "KCHREPO6005M": "$_("Name")",
-    "KCHREPO6006M": "$_("Base URL")",
-    "KCHREPO6007M": "$_("Is Mirror")",
-    "KCHREPO6008M": "$_("URL Args")",
-    "KCHREPO6009M": "$_("Enabled")",
-    "KCHREPO6010M": "$_("GPG Check")",
-    "KCHREPO6011M": "$_("GPG Key")",
-    "KCHREPO6012M": "$_("Add")",
-    "KCHREPO6013M": "$_("Edit")",
-    "KCHREPO6014M": "$_("Remove")",
-    "KCHREPO6016M": "$_("Enable")",
-    "KCHREPO6017M": "$_("Disable")",
-
-
-    "KCHUPD6001M": "$_("Software Updates")",
-    "KCHUPD6002M": "$_("Package Name")",
-    "KCHUPD6003M": "$_("Version")",
-    "KCHUPD6004M": "$_("Architecture")",
-    "KCHUPD6005M": "$_("Repository")",
-    "KCHUPD6006M": "$_("Update All")",
-    "KCHUPD6007M": "$_("Updating...")",
-    "KCHUPD6008M": "$_("Failed to retrieve packages update information.")",
-    "KCHUPD6009M": "$_("Failed to update package(s).")",
-
-
-    "KCHDR6001M": "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")",
-    "KCHDR6002M": "$_("Debug Reports")",
-    "KCHDR6003M": "$_("Name")",
-    "KCHDR6005M": "$_("Generated Time")",
-    "KCHDR6006M": "$_("Generate")",
-    "KCHDR6007M": "$_("Generating...")",
-    "KCHDR6008M": "$_("Rename")",
-    "KCHDR6009M": "$_("Remove")",
-    "KCHDR6010M": "$_("Download")",
-    "KCHDR6011M": "$_("Report name should contain only letters, digits, underscore ('_') and/or hyphen ('-').")",
-    "KCHDR6012M": "$_("Pending...")",
-    "KCHDR6013M": "$_("Report name is the same as the original one.")",
-
     "KCHVM6001M": "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
     "KCHVM6002M": "$_("Power off Confirmation")",
     "KCHVM6003M": "$_("This action may produce undesirable results, "
-- 
2.1.0




More information about the Kimchi-devel mailing list