From michael.sole at soledevelopment.com Thu Jul 2 15:03:29 2015 From: michael.sole at soledevelopment.com (Michael Sole) Date: Thu, 2 Jul 2015 11:03:29 -0400 Subject: [Kimchi-devel] CentOS Init Script Message-ID: <30b85ec14768e6c7d0c3da30dc9435e3.squirrel@mail.soledevelopment.com> I created a very simple CentOS 6 compatible init script. Its a little hacky but it does work. I know I am supposed to make a patch but perhaps someone can evaluate and decide if you want to include it: #!/bin/sh # # Name: Kimchi init script for CentOS 6 # Author: Michael Sole # Email: michael.sole(at)soledevelopment.com # # Description: Very simple init script to start, stop and restart the Kimchi control panel # # Usage: /etc/init.d/kimchid start|stop|restart ### BEGIN INIT INFO # Provides: kimchid # Required-Start: $local_fs $syslog # Required-Stop: $local_fs $syslog # Default-Start: 2345 # Default-Stop: 90 # Short-Description: run kimchi daemon # Description: Very simple init script to start, stop and restart the Kimchi control panel ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions exec="/usr/bin/kimchid" prog="kimchid" lockfile=/var/lock/subsys/$prog start() { if [ -f "$lockfile" ] then echo "Lock file found, is the daemon already running?" exit 5 fi echo -n $"Starting $prog: " nohup $exec > /dev/null 2>&1 & echo "OK" touch $lockfile return 0 } stop() { echo -n $"Stopping $prog: " rm -f $lockfile ps aux | grep -ie $prog | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1 return 0 } restart() { stop start } case "$1" in start) $1 ;; stop) $1 ;; restart) $1 ;; *) echo $"Usage: $0 {start|stop|restart}" exit 2 esac exit $? From alinefm at linux.vnet.ibm.com Fri Jul 3 12:39:56 2015 From: alinefm at linux.vnet.ibm.com (Aline Manera) Date: Fri, 03 Jul 2015 09:39:56 -0300 Subject: [Kimchi-devel] [PATCH 2/2] Review changes for Kimchi In-Reply-To: <1435704502-8836-1-git-send-email-kersten@us.ibm.com> References: <1435704502-8836-1-git-send-email-kersten@us.ibm.com> Message-ID: <5596829C.5080904@linux.vnet.ibm.com> On 30/06/2015 19:48, Kersten wrote: > Made changes to 3 files per comments from Aline. > > Signed-off-by: Kersten > --- > ui/pages/help/en_US/guests.dita | 30 +++++++++++++++--------------- > ui/pages/help/en_US/storage.dita | 8 ++++---- > ui/pages/help/en_US/templates.dita | 15 +++++++++------ > 3 files changed, 28 insertions(+), 25 deletions(-) > > diff --git a/ui/pages/help/en_US/guests.dita b/ui/pages/help/en_US/guests.dita > index 7d0d453..45cf7da 100644 > --- a/ui/pages/help/en_US/guests.dita > +++ b/ui/pages/help/en_US/guests.dita > @@ -10,14 +10,14 @@ https://w3.opensource.ibm.com/projects/dita-cshelp/--> > > Guests > The Guests page lists the defined > -guests or virtual machines. > +guests for your server. > >

For each guest, the following information is displayed:

>
Name
> -
Name of the virtual machine.
> +
Name of the guest.
>
>
CPU
> -
Percentage of processor utilization in the virtual machine.
> +
Percentage of processor utilization in the guest.
>
>
Disk I/O
>
Disk input/output transmission rate in KB per seconds.
> @@ -53,16 +53,16 @@ existing guest. Guests can be edited only while stopped. >
  • Select Power Off to force an immediate > shut down of the guest.
  • >
  • Select Delete to delete the guest.
  • > -To create a guest, or virtual machine, click the plus > -(+) icon on the page.

    > +To create a guest, click the plus (+) icon > +on the page.

    > > > -Create a guest (virtual machine) > +Create a guest > Create a guest by using an existing template. > >

      > -
    1. Type the name to be used to identify the virtual machine.
    2. > -
    3. Select a template.
        > +
      • Type the name to be used to identify the guest.
      • > +
      • Select a template.
          >
        • If templates exist, select from displayed templates.
        • >
        • If no templates exist, click Create a template to > create a template.
        • > @@ -73,9 +73,9 @@ create a template. > > > Edit guest > -Edit the properties of an existing virtual machine. Some > -properties can be edited only while guest is stopped. Others will > -take effect in next boot. > +Edit the properties of an existing guest. Some properties > +can be edited only while guest is stopped. Others will take effect > +in next boot. > >
          >
          General
          > @@ -124,11 +124,11 @@ guest. > iSCSI volumes or if the target pool does not have enough space, the > clone will be created on a default storage pool. >
    > -

    A guest appears in your list with the label "cloning..." When the > -process is complete, the cloned guest is available to use.

    -Caret 54?> > +

    A guest appears in your list with the label Cloning... When > +the process is complete, the cloned guest is available to use.

    +Caret 45?> >
    >
    > > > - > + > diff --git a/ui/pages/help/en_US/storage.dita b/ui/pages/help/en_US/storage.dita > index e6f995d..53d1404 100644 > --- a/ui/pages/help/en_US/storage.dita > +++ b/ui/pages/help/en_US/storage.dita > @@ -94,16 +94,16 @@ pool is created, it will be created for you. > > > Add volume > -Adds volume to a storage pool. > +Adds volume to a storage pool. > >
    >
    Fetch from remote URL
    > -
    Specifies a location to upload the volume from. For example: https://my-server/fedora22.img.
    > +
    Specifies a location to download the volume from. For example: https://my-server/fedora22.img.
    >
    >
    Upload a file
    >
    Specifies a location on your local system.
    > -
    > +
    >
    >
    > > - > + > diff --git a/ui/pages/help/en_US/templates.dita b/ui/pages/help/en_US/templates.dita > index 1c03016..ad3747c 100644 > --- a/ui/pages/help/en_US/templates.dita > +++ b/ui/pages/help/en_US/templates.dita > @@ -55,7 +55,7 @@ You can select multiple networks. >
    In the CPU Number field, specify the number > of processors that are defined for the template.
    >
    Select to Manually set CPU topology for each guest.
    > - > + > > > > @@ -69,16 +69,19 @@ ISO image to 'ISO' storage pool for following discovery. >
    Select to scan storage pools for installation ISO images available > on the system.
    > > +
    Local Image File
    > +
    Select to specify a path to the local image file.
    > +
    >
    Remote ISO image
    >
    Select to specify a remote location for an installation ISO image.
    >
    > >
    > > -Add template - local ISO image > -Add a template from a local ISO image. > +Add template - ISO image > +Add a template from a ISO image. > > -

    The ISO images available on the system are displayed.

    > +

    The ISO images available on the system ore remotely are displayed.

    Just a typo here 'ore' but I can fix is before applying. >
    >
    OS
    >
    Name of the operating system or distribution.
    > @@ -105,7 +108,7 @@ specify a path to the ISO image. > ISO images. > > > - > + > > > - > + From alinefm at linux.vnet.ibm.com Fri Jul 3 12:55:25 2015 From: alinefm at linux.vnet.ibm.com (Aline Manera) Date: Fri, 03 Jul 2015 12:55:25 -0000 Subject: [Kimchi-devel] [PATCH] Help updates for Kimchi In-Reply-To: <1435176912-32380-1-git-send-email-kersten@us.ibm.com> Message-ID: <201507031255.t63CtPbr015967@d01av01.pok.ibm.com> Applied. Thanks. Regards, Aline Manera From alinefm at linux.vnet.ibm.com Fri Jul 3 12:56:11 2015 From: alinefm at linux.vnet.ibm.com (Aline Manera) Date: Fri, 03 Jul 2015 09:56:11 -0300 Subject: [Kimchi-devel] [PATCH 2/2] Review changes for Kimchi In-Reply-To: <1435704502-8836-1-git-send-email-kersten@us.ibm.com> References: <1435704502-8836-1-git-send-email-kersten@us.ibm.com> Message-ID: <5596866B.40108@linux.vnet.ibm.com> Applied. Thanks. Regards, Aline Manera From alinefm at linux.vnet.ibm.com Fri Jul 3 17:55:45 2015 From: alinefm at linux.vnet.ibm.com (Aline Manera) Date: Fri, 03 Jul 2015 14:55:45 -0300 Subject: [Kimchi-devel] New branches upstream In-Reply-To: <5591C2F7.1070305@linux.vnet.ibm.com> References: <5591C2F7.1070305@linux.vnet.ibm.com> Message-ID: <5596CCA1.1090102@linux.vnet.ibm.com> I've just updated the wok branch upstream. It contains the latest wok changes from Lucio + the new UI widgets patches. Please, while sending patches for review add the tag *[wok] *to have your patch applied into wok branch or *[next] *to get the patch applied on next branch. Thanks, Aline Manera On 29/06/2015 19:13, Aline Manera wrote: > Hi all, > > As we decided for a stabilization release after 1.5, I will create a > new branch named 'next' to apply the patches not related to bug fixes. > Once we get 1.5.1 released, the 'next' branch will be merged into 'master' > > I will also create the 'wok' branch to handle the wok framework and > the new UI development. > I want to use the 1.5.1 time frame to test as much as we can the wok > framework and the new UI we can release all that right after 1.5.1 > > Summary: > - master: current release development > - next : new features > - wok : disruptive > features (wok framework + new UI) > > The current 'wok' branch is a copy of the master branch. > I am working with Lucio to get the new UI patches merged with the > 'wok' patches so we can update the upstream branch accordingly. > > Regards, > Aline Manera > > > _______________________________________________ > Kimchi-devel mailing list > Kimchi-devel at ovirt.org > http://lists.ovirt.org/mailman/listinfo/kimchi-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From frediz at linux.vnet.ibm.com Mon Jul 6 15:10:56 2015 From: frediz at linux.vnet.ibm.com (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bonnard?=) Date: Mon, 6 Jul 2015 17:10:56 +0200 Subject: [Kimchi-devel] [PATCH] Fix minus in manpage Message-ID: <1436195456-18218-1-git-send-email-frediz@linux.vnet.ibm.com> From: Frederic Bonnard Escape minus for options so they don't get interpreted as hyphens. --- docs/kimchid.8.in | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/kimchid.8.in b/docs/kimchid.8.in index 08e96e5..d715e87 100644 --- a/docs/kimchid.8.in +++ b/docs/kimchid.8.in @@ -17,35 +17,35 @@ supports HTML5. .SH OPTIONS The following options are supported: .TP -\fB-h\fP , \fB--help\fP +\fB\-h\fP , \fB\-\-help\fP Show this help message and exit. .TP -\fB--host\fP \fIhost\fP +\fB\-\-host\fP \fIhost\fP Specify the hostname or IP to listen on. .TP -\fB--port\fP \fIport\fP +\fB\-\-port\fP \fIport\fP Specify the HTTP port (default \fI8000\fP). .TP -\fB--ssl-port\fP \fIssl_port\fP +\fB\-\-ssl-port\fP \fIssl_port\fP Specify the HTTPS port (default \fI8001\fP). .TP -\fB--cherrypy_port\fP \fIcherrypy_port\fP +\fB\-\-cherrypy_port\fP \fIcherrypy_port\fP Specify the Cherrypy server port (default \fI8010\fP). .TP -\fB--log-level\fP [\fIdebug\fP | \fIinfo\fP | \fIwarning\fP | \fIerror\fP | \fIcritical\fP] +\fB\-\-log-level\fP [\fIdebug\fP | \fIinfo\fP | \fIwarning\fP | \fIerror\fP | \fIcritical\fP] Specify the log level (default \fIdebug\fP). .TP -\fB--access-log\fP \fIaccess_log\fP +\fB\-\-access-log\fP \fIaccess_log\fP Specify the access log location where kimchi should create the access log file. .TP -\fB--environment\fP [\fIdevelopment\fP | \fIproduction\fP] +\fB\-\-environment\fP [\fIdevelopment\fP | \fIproduction\fP] Specify the running environment of kimchi server. Check cherrypy documentation for more details (default \fIproduction\fP). .TP -\fB--federation\fP [\fIon\fP | \fIoff\fP] +\fB\-\-federation\fP [\fIon\fP | \fIoff\fP] Register and discover Kimchi peers in the same network using OpenSLP. Check below the \fBFEDERATION\fP section for more details (default \fIoff\fP). .TP -\fB--test\fP +\fB\-\-test\fP Run kimchi on a mock version that does not affect the system. For testing proposals. .SH FEDERATION Federation feature is a mechanism to discover Kimchi peers in the same network. @@ -63,23 +63,23 @@ To enable it, do the following: ports in your firewall configuration For system using firewalld, do: - sudo firewall-cmd --permanent --add-port=427/udp - sudo firewall-cmd --permanent --add-port=427/tcp - sudo firewall-cmd --reload + sudo firewall-cmd \-\-permanent \-\-add-port=427/udp + sudo firewall-cmd \-\-permanent \-\-add-port=427/tcp + sudo firewall-cmd \-\-reload For openSUSE systems, do: sudo /sbin/SuSEfirewall2 open EXT TCP 427 sudo /sbin/SuSEfirewall2 open EXT UDP 427 For system using iptables, do: - sudo iptables -A INPUT -p tcp --dport 427 -j ACCEPT - sudo iptables -A INPUT -p udp --dport 427 -j ACCEPT + sudo iptables \-A INPUT \-p tcp \-\-dport 427 \-j ACCEPT + sudo iptables \-A INPUT \-p udp \-\-dport 427 \-j ACCEPT 3. In addition to the OpenSLP ports, you also need to allow multicast in the firewall configuration For system using firewalld, do: - sudo firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -s -j ACCEPT + sudo firewall-cmd \-\-direct \-\-add-rule ipv4 filter INPUT 0 \-s \-j ACCEPT For openSUSE systems, do: Add the subnet to the trusted networks listed on FW_TRUSTED_NETS in @@ -87,7 +87,7 @@ To enable it, do the following: Make sure to restart /sbin/SuSEfirewall2 after modifying /etc/sysconfig/SuSEfirewall2 For system using iptables, do: - sudo iptables -A INPUT -s -j ACCEPT + sudo iptables \-A INPUT \-s \-j ACCEPT 4. Start slpd service and make sure it is up while running Kimchi sudo service slpd start -- 2.1.4 From joserz at linux.vnet.ibm.com Wed Jul 8 17:42:44 2015 From: joserz at linux.vnet.ibm.com (Jose Ricardo Ziviani) Date: Wed, 8 Jul 2015 14:42:44 -0300 Subject: [Kimchi-devel] [PATCH 0/3] Add usb xhci controller for hotplug on Power Message-ID: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> Power system requires an USB XHCI controller in order to allow PCI hotplug. This patch adds such controller by default when creating a new VM and inform the users if a VM currently doesn't have the controller. Jose Ricardo Ziviani (3): Add a new error code for pci hotplug Check for usb xhci controller in Power platform Define the USB xhci controller in the template for Power Systems src/kimchi/i18n.py | 1 + src/kimchi/model/vmhostdevs.py | 28 +++++++++++++++++++++++++++- src/kimchi/vmtemplate.py | 17 +++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) -- 1.9.1 From joserz at linux.vnet.ibm.com Wed Jul 8 17:42:46 2015 From: joserz at linux.vnet.ibm.com (Jose Ricardo Ziviani) Date: Wed, 8 Jul 2015 14:42:46 -0300 Subject: [Kimchi-devel] [PATCH 2/3] Check for usb xhci controller in Power platform In-Reply-To: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> Message-ID: <1436377367-18815-3-git-send-email-joserz@linux.vnet.ibm.com> - Today it is not possible to hotplug a PCI in Power Systems without an USB xhci controller existing in the VM. This commit checks if there is such controller in the VM, displaying an error message if not. Signed-off-by: Jose Ricardo Ziviani --- src/kimchi/model/vmhostdevs.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/kimchi/model/vmhostdevs.py b/src/kimchi/model/vmhostdevs.py index ea75fce..186e542 100644 --- a/src/kimchi/model/vmhostdevs.py +++ b/src/kimchi/model/vmhostdevs.py @@ -171,6 +171,26 @@ class VMHostDevsModel(object): if rc != 0: kimchi_log.warning("Unable to turn on sebool virt_use_sysfs") + def _have_xhci_usb_controller(self, xmlstr): + root = objectify.fromstring(xmlstr) + + try: + controllers = root.devices.controller + + except AttributeError: + return False + + for controller in controllers: + + if 'model' not in controller.attrib: + continue + + if controller.attrib['type'] == 'usb' and \ + controller.attrib['model'] == 'nec-xhci': + return True + + return False + def _attach_pci_device(self, vmid, dev_info): self._validate_pci_passthrough_env() @@ -180,11 +200,17 @@ class VMHostDevsModel(object): driver = ('vfio' if DOM_STATE_MAP[dom.info()[0]] == "shutoff" and self.caps.kernel_vfio else 'kvm') - # on powerkvm systems it must be vfio driver. distro, _, _ = platform.linux_distribution() if distro == 'IBM_PowerKVM': + # on powerkvm systems, the driver must be vfio. driver = 'vfio' + # powerkvm requires a xhci usb controller in order to support + # pci hotplug. + if DOM_STATE_MAP[dom.info()[0]] != "shutoff" and \ + not self._have_xhci_usb_controller(dom.XMLDesc(0)): + raise InvalidOperation("KCHVMHDEV0006E", {'vmid': vmid}) + # Attach all PCI devices in the same IOMMU group dev_model = DeviceModel(conn=self.conn) devs_model = DevicesModel(conn=self.conn) -- 1.9.1 From joserz at linux.vnet.ibm.com Wed Jul 8 17:42:45 2015 From: joserz at linux.vnet.ibm.com (Jose Ricardo Ziviani) Date: Wed, 8 Jul 2015 14:42:45 -0300 Subject: [Kimchi-devel] [PATCH 1/3] Add a new error code for pci hotplug In-Reply-To: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> Message-ID: <1436377367-18815-2-git-send-email-joserz@linux.vnet.ibm.com> Signed-off-by: Jose Ricardo Ziviani --- src/kimchi/i18n.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py index d2ffa34..54750d9 100644 --- a/src/kimchi/i18n.py +++ b/src/kimchi/i18n.py @@ -127,6 +127,7 @@ messages = { "For AMD CPU, add iommu=pt iommu=1."), "KCHVMHDEV0004E": _('"name" should be a device name string'), "KCHVMHDEV0005E": _('The device %(name)s is probably in use by the host. Unable to attach it to the guest.'), + "KCHVMHDEV0006E": _('VM %(vmid)s does not have an USB XHCI controller to accept PCI hotplug.'), "KCHVMIF0001E": _("Interface %(iface)s does not exist in virtual machine %(name)s"), "KCHVMIF0002E": _("Network %(network)s specified for virtual machine %(name)s does not exist"), -- 1.9.1 From joserz at linux.vnet.ibm.com Wed Jul 8 17:42:47 2015 From: joserz at linux.vnet.ibm.com (Jose Ricardo Ziviani) Date: Wed, 8 Jul 2015 14:42:47 -0300 Subject: [Kimchi-devel] [PATCH 3/3] Define the USB xhci controller in the template for Power Systems In-Reply-To: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> References: <1436377367-18815-1-git-send-email-joserz@linux.vnet.ibm.com> Message-ID: <1436377367-18815-4-git-send-email-joserz@linux.vnet.ibm.com> - When creating VMs using Kimchi in a Power System, the USB xhci controller is defined by default to have PCI hotplug support. Signed-off-by: Jose Ricardo Ziviani --- src/kimchi/vmtemplate.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py index 79e04ed..3e42971 100644 --- a/src/kimchi/vmtemplate.py +++ b/src/kimchi/vmtemplate.py @@ -22,6 +22,7 @@ import stat import time import urlparse import uuid +import platform from lxml import etree from lxml.builder import E @@ -287,6 +288,19 @@ class VMTemplate(object): self.info.get('memory') << 10, cpu_topo) + def _get_usb_controller(self): + # powerkvm systems must include xhci controller model + distro, _, _ = platform.linux_distribution() + if distro != "IBM_PowerKVM": + return '' + + return """ + +
    + + """ + def to_vm_xml(self, vm_name, vm_uuid, **kwargs): params = dict(self.info) params['name'] = vm_name @@ -323,6 +337,8 @@ class VMTemplate(object): elif params['slots'] == 0: params['slots'] = 1 + params['usb_controller'] = self._get_usb_controller() + xml = """ %(qemu-stream-cmdline)s @@ -352,6 +368,7 @@ class VMTemplate(object): %(networks)s %(graphics)s %(input_output)s + %(usb_controller)s -- 1.9.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:39 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:39 -0300 Subject: [Kimchi-devel] [PATCH V3 07/34] Update kimchi plugin docs In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-8-git-send-email-luciojhc@linux.vnet.ibm.com> Update kimchi plugin documentation to reflect new plugin structure. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/docs/API.md | 112 ++++++++++++++---------------- plugins/kimchi/docs/README-federation.md | 18 +++--- plugins/kimchi/docs/README.md | 37 +++++++--- 3 files changed, 86 insertions(+), 81 deletions(-) diff --git a/plugins/kimchi/docs/API.md b/plugins/kimchi/docs/API.md index e022c9e..bfefeab 100644 --- a/plugins/kimchi/docs/API.md +++ b/plugins/kimchi/docs/API.md @@ -31,13 +31,13 @@ the following general conventions: URI. Available *actions* are described within the *actions* property of a Resource representation. The request body *must* contain a JSON object which specifies parameters. -* URIs begin with a '/' to indicate the root of the API. +* URIs begin with '/plugins/kimchi' to indicate the root of Kimchi plugin. * Variable segments in the URI begin with a ':' and should replaced with the appropriate resource identifier. ### Collection: Virtual Machines -**URI:** /vms +**URI:** /plugins/kimchi/vms **Methods:** @@ -61,7 +61,7 @@ the following general conventions: ### Resource: Virtual Machine -**URI:** /vms/*:name* +**URI:** /plugins/kimchi/vms/*:name* **Methods:** @@ -149,7 +149,7 @@ the following general conventions: ### Sub-resource: Virtual Machine Screenshot -**URI:** /vms/*:name*/screenshot +**URI:** /plugins/kimchi/vms/*:name*/screenshot Represents a snapshot of the Virtual Machine's primary monitor. @@ -159,7 +159,7 @@ Represents a snapshot of the Virtual Machine's primary monitor. ### Sub-collection: Virtual Machine storages -**URI:** /vms/*:name*/storages +**URI:** /plugins/kimchi/vms/*:name*/storages * **GET**: Retrieve a summarized list of all storages of specified guest * **POST**: Attach a new storage or virtual drive to specified virtual machine. * type: The type of the storage (currently support 'cdrom' and 'disk'). @@ -168,7 +168,7 @@ Represents a snapshot of the Virtual Machine's primary monitor. * vol: Storage volume name of disk image. ### Sub-resource: storage -**URI:** /vms/*:name*/storages/*:dev* +**URI:** /plugins/kimchi/vms/*:name*/storages/*:dev* * **GET**: Retrieve storage information * dev: The name of the storage in the vm. * type: The type of the storage (currently support 'cdrom' and 'disk'). @@ -182,28 +182,28 @@ Represents a snapshot of the Virtual Machine's primary monitor. ### Sub-collection: Virtual Machine Passthrough Devices -**URI:** /vms/*:name*/hostdevs +**URI:** /plugins/kimchi/vms/*:name*/hostdevs * **GET**: Retrieve a summarized list of all directly assigned host device of specified guest. * **POST**: Directly assign a host device to guest. * name: The name of the host device to be assigned to vm. ### Sub-resource: Device -**URI:** /vms/*:name*/hostdevs/*:dev* +**URI:** /plugins/kimchi/vms/*:name*/hostdevs/*:dev* * **GET**: Retrieve assigned device information * name: The name of the assigned device. * type: The type of the assigned device. * **DELETE**: Detach the host device from VM. ### Sub-collection: Virtual Machine Snapshots -**URI:** /vms/*:name*/snapshots +**URI:** /plugins/kimchi/vms/*:name*/snapshots * **POST**: Create a new snapshot on a VM. * name: The snapshot name (optional, defaults to a value based on the current time). * **GET**: Retrieve a list of snapshots on a VM. ### Sub-resource: Snapshot -**URI:** /vms/*:name*/snapshots/*:snapshot* +**URI:** /plugins/kimchi/vms/*:name*/snapshots/*:snapshot* * **GET**: Retrieve snapshot information. * created: The time when the snapshot was created (in seconds, since the epoch). @@ -220,12 +220,12 @@ Represents a snapshot of the Virtual Machine's primary monitor. * revert: Revert the domain to the given snapshot. ### Sub-resource: Current snapshot -**URI:** /vms/*:name*/snapshots/current +**URI:** /plugins/kimchi/vms/*:name*/snapshots/current * **GET**: Retrieve current snapshot information for the virtual machine. ### Collection: Templates -**URI:** /templates +**URI:** /plugins/kimchi/templates **Methods:** @@ -270,7 +270,7 @@ Represents a snapshot of the Virtual Machine's primary monitor. ### Sub-Collection: Virtual Machine Network Interfaces -**URI:** /vms/*:name*/ifaces +**URI:** /plugins/kimchi/vms/*:name*/ifaces Represents all network interfaces attached to a Virtual Machine. @@ -289,7 +289,7 @@ Represents all network interfaces attached to a Virtual Machine. ### Sub-Resource: Virtual Machine Network Interface -**URI:** /vms/*:name*/ifaces/*:mac* +**URI:** /plugins/kimchi/vms/*:name*/ifaces/*:mac* A interface represents available network interface on VM. @@ -324,7 +324,7 @@ A interface represents available network interface on VM. ### Resource: Template -**URI:** /templates/*:name* +**URI:** /plugins/kimchi/templates/*:name* **Methods:** @@ -397,7 +397,7 @@ A interface represents available network interface on VM. ### Collection: Storage Pools -**URI:** /storagepools +**URI:** /plugins/kimchi/storagepools **Methods:** @@ -428,7 +428,7 @@ A interface represents available network interface on VM. ### Resource: Storage Pool -**URI:** /storagepools/*:name* +**URI:** /plugins/kimchi/storagepools/*:name* **Methods:** @@ -473,7 +473,7 @@ A interface represents available network interface on VM. ### Collection: Storage Volumes -**URI:** /storagepools/*:poolname*/storagevolumes +**URI:** /plugins/kimchi/storagepools/*:poolname*/storagevolumes **Methods:** @@ -493,7 +493,7 @@ A interface represents available network interface on VM. ### Resource: Storage Volume -**URI:** /storagepools/*:poolname*/storagevolumes/*:name* +**URI:** /plugins/kimchi/storagepools/*:poolname*/storagevolumes/*:name* **Methods:** @@ -531,7 +531,7 @@ A interface represents available network interface on VM. ### Collection: Interfaces -**URI:** /interfaces +**URI:** /plugins/kimchi/interfaces **Methods:** @@ -539,7 +539,7 @@ A interface represents available network interface on VM. ### Resource: Interface -**URI:** /interfaces/*:name* +**URI:** /plugins/kimchi/interfaces/*:name* A interface represents available interface on host. @@ -570,7 +570,7 @@ A interface represents available interface on host. ### Collection: Networks -**URI:** /networks +**URI:** /plugins/kimchi/networks **Methods:** @@ -592,7 +592,7 @@ A interface represents available interface on host. ### Resource: Network -**URI:** /networks/*:name* +**URI:** /plugins/kimchi/networks/*:name* **Methods:** @@ -637,7 +637,7 @@ A interface represents available interface on host. ### Collection: Tasks -**URI:** /tasks +**URI:** /plugins/kimchi/tasks **Methods:** @@ -645,7 +645,7 @@ A interface represents available interface on host. ### Resource: Task -**URI:** /tasks/*:id* +**URI:** /plugins/kimchi/tasks/*:id* A task represents an asynchronous operation that is being performed by the server. @@ -668,7 +668,7 @@ server. ### Resource: Configuration -**URI:** /config +**URI:** /plugins/kimchi/config Contains information about the application environment and configuration. @@ -685,7 +685,7 @@ Contains information about the application environment and configuration. ### Resource: Capabilities -**URI:** /config/capabilities +**URI:** /plugins/kimchi/config/capabilities Contains information about the host capabilities: iso streaming, screenshot creation. @@ -716,7 +716,7 @@ creation. ### Collection: Storage Servers -**URI:** /storageservers +**URI:** /plugins/kimchi/storageservers **Methods:** @@ -727,7 +727,7 @@ creation. ### Resource: Storage Server -**URI:** /storageservers/*:host* +**URI:** /plugins/kimchi/storageservers/*:host* **Methods:** @@ -737,7 +737,7 @@ creation. ### Collection: Storage Targets -**URI:** /storageservers/*:name*/storagetargets +**URI:** /plugins/kimchi/storageservers/*:name*/storagetargets **Methods:** @@ -754,7 +754,7 @@ creation. ### Collection: Distros -**URI:** /config/distros +**URI:** /plugins/kimchi/config/distros **Methods:** @@ -762,7 +762,7 @@ creation. ### Resource: Distro -**URI:** /config/distros/*:name* +**URI:** /plugins/kimchi/config/distros/*:name* Contains information about the OS distribution. @@ -780,7 +780,7 @@ Contains information about the OS distribution. #### Collection: Debug Reports -**URI:** /debugreports +**URI:** /plugins/kimchi/debugreports **Methods:** @@ -792,7 +792,7 @@ Contains information about the OS distribution. ### Resource: Debug Report -**URI:** /debugreports/*:name* +**URI:** /plugins/kimchi/debugreports/*:name* A Debug Report is an archive of logs and other information about the host that is used to diagnose and debug problems. The exact format and contents are @@ -819,7 +819,7 @@ specific to the low level collection tool being used. ### Sub-resource: Debug Report content -**URI:** /debugreports/*:name*/content +**URI:** /plugins/kimchi/debugreports/*:name*/content It is the sub-resource of Debug Report and the client use it to get the real content of the Debug Report file from the server @@ -832,7 +832,7 @@ of the Debug Report file from the server ### Resource: Host -**URI:** /host +**URI:** /plugins/kimchi/host Contains information of host. **Methods:** @@ -859,7 +859,7 @@ Contains information of host. ### Resource: Users -**URI:** /users +**URI:** /plugins/kimchi/users List of available users. **Methods:** @@ -871,7 +871,7 @@ List of available users. ### Resource: Groups -**URI:** /groups +**URI:** /plugins/kimchi/groups List of available groups. **Methods:** @@ -880,7 +880,7 @@ List of available groups. ### Resource: HostStats -**URI:** /host/stats +**URI:** /plugins/kimchi/host/stats Contains the host sample data. @@ -912,7 +912,7 @@ Contains the host sample data. ### Resource: HostStats -**URI:** /host/cpuinfo +**URI:** /plugins/kimchi/host/cpuinfo The cores and sockets of a hosts's CPU. Useful when sizing VMs to take advantages of the perforamance benefits of SMT (Power) or Hyper-Threading (Intel). @@ -936,7 +936,7 @@ advantages of the perforamance benefits of SMT (Power) or Hyper-Threading (Intel ### Resource: HostStatsHistory -**URI:** /host/stats/history +**URI:** /plugins/kimchi/host/stats/history It is the sub-resource of Host Stats and the client uses it to get the host stats history @@ -962,17 +962,9 @@ stats history *No actions defined* -### Collection: Plugins - -**URI:** /plugins - -**Methods:** - -* **GET**: Retrieve a summarized list names of all UI Plugins - ### Collection: Partitions -**URI:** /host/partitions +**URI:** /plugins/kimchi/host/partitions **Methods:** @@ -980,7 +972,7 @@ stats history ### Resource: Partition -**URI:** /host/partitions/*:name* +**URI:** /plugins/kimchi/host/partitions/*:name* **Methods:** @@ -998,7 +990,7 @@ stats history ### Collection: Devices -**URI:** /host/devices +**URI:** /plugins/kimchi/host/devices **Methods:** @@ -1016,7 +1008,7 @@ stats history ### Resource: Device -**URI:** /host/devices/*:name* +**URI:** /plugins/kimchi/host/devices/*:name* **Methods:** @@ -1045,11 +1037,11 @@ stats history ### Sub-collection: VMs with the device assigned. -**URI:** /host/devices/*:name*/vmholders +**URI:** /plugins/kimchi/host/devices/*:name*/vmholders * **GET**: Retrieve a summarized list of all VMs holding the device. ### Sub-resource: VM holder -**URI:** /host/devices/*:name*/vmholders/*:vm* +**URI:** /plugins/kimchi/host/devices/*:name*/vmholders/*:vm* * **GET**: Retrieve information of the VM which is holding the device * name: The name of the VM. * state: The power state of the VM. Could be "running" and "shutdown". @@ -1057,7 +1049,7 @@ stats history ### Collection: Host Packages Update -**URI:** /host/packagesupdate +**URI:** /plugins/kimchi/host/packagesupdate Contains the information and action of packages update in the host. @@ -1067,7 +1059,7 @@ Contains the information and action of packages update in the host. ### Resource: Host Package Update -**URI:** /host/packagesupdate/*:name* +**URI:** /plugins/kimchi/host/packagesupdate/*:name* Contains the information for a specific package to be updated. @@ -1081,7 +1073,7 @@ Contains the information for a specific package to be updated. ### Collection: Host Repositories -**URI:** /host/repositories +**URI:** /plugins/kimchi/host/repositories **Methods:** @@ -1101,7 +1093,7 @@ http://, ftp:// or file:// URL. ### Resource: Repository -**URI:** /host/repositories/*:repo-id* +**URI:** /plugins/kimchi/host/repositories/*:repo-id* **Methods:** @@ -1147,7 +1139,7 @@ http://, ftp:// or file:// URL. ### Collection: Peers -**URI:** /peers +**URI:** /plugins/kimchi/peers **Methods:** diff --git a/plugins/kimchi/docs/README-federation.md b/plugins/kimchi/docs/README-federation.md index b71a172..c184f4f 100644 --- a/plugins/kimchi/docs/README-federation.md +++ b/plugins/kimchi/docs/README-federation.md @@ -1,11 +1,11 @@ Kimchi Project - Federation Feature =================================== -Federation feature is a mechanism to discover Kimchi peers in the same network. -It uses openSLP tool (http://www.openslp.org/) to register and find the Kimchi +Federation feature is a Kimchi mechanism to discover Wok peers in the same +network. It uses openSLP tool (http://www.openslp.org/) to register and find Wok servers. -By default this feature is disabled on Kimchi as it is not critical for KVM +By default this feature is disabled on Wok as it is not critical for KVM virtualization and requires additional software installation. To enable it, do the following: @@ -43,18 +43,18 @@ To enable it, do the following: For system using iptables, do: sudo iptables -A INPUT -s -j ACCEPT -4. Start slpd service and make sure it is up while running Kimchi +4. Start slpd service and make sure it is up while running Wok sudo service slpd start -5. Enable federation on Kimchi by editing the /etc/kimchi/kimchi.conf file: +5. Enable federation on Wok by editing the /etc/wok/wok.conf file: federation = on -6. Then start Kimchi service - sudo service kimchid start +6. Then start Wok service + sudo service wokd start -The Kimchi server will be registered on openSLP on server starting up and will -be found by other Kimchi peers (with federation feature enabled) in the same +The Wok server will be registered on openSLP on server starting up and will +be found by other Wok peers (with federation feature enabled) in the same network. Enjoy! diff --git a/plugins/kimchi/docs/README.md b/plugins/kimchi/docs/README.md index 034a591..f400333 100644 --- a/plugins/kimchi/docs/README.md +++ b/plugins/kimchi/docs/README.md @@ -4,9 +4,10 @@ Kimchi Project Kimchi is an HTML5 based management tool for KVM. It is designed to make it as easy as possible to get started with KVM and create your first guest. -Kimchi runs as a daemon on the hypervisor host. It manages KVM guests through -libvirt. The management interface is accessed over the web using a browser that -supports HTML5. +Kimchi runs as a Wok plugin. Wok runs as a daemon on the hypervisor host. + +Kimchi manages KVM guests through libvirt. The management interface is accessed +over the web using a browser that supports HTML5. Browser Support =============== @@ -33,11 +34,11 @@ find. Hypervisor Distro Support ========================= -Kimchi daemon might run on any GNU/Linux distribution that meets the conditions +Kimchi and Wok might run on any GNU/Linux distribution that meets the conditions described on the 'Getting Started' section below. -The Kimchi community makes an effort to test with the latest versions of Fedora, -RHEL, OpenSuSe, and Ubuntu. +The Kimchi community makes an effort to test it with the latest versions of +Fedora, RHEL, OpenSuSe, and Ubuntu. Getting Started =============== @@ -125,6 +126,17 @@ information on how configure your system to access this repository. Build and Install ----------------- + + Wok: + $ ./autogen.sh --system + + $ make + $ sudo make install # Optional if running from the source tree + + + Kimchi: + $ cd plugins/kimchi + For openSUSE 13.1: $ ./autogen.sh --with-spice-html5 @@ -137,12 +149,12 @@ Build and Install Run --- - $ sudo kimchid --host=0.0.0.0 + $ sudo wokd --host=0.0.0.0 -If you cannot access Kimchi, take a look at these 2 points: +If you cannot access Wok, take a look at these 2 points: 1. Firewall -Kimchi uses by default the ports 8000, 8001 and 64667. To allow incoming connections: +Wok uses by default the ports 8000, 8001 and 64667. To allow incoming connections: For system using firewalld, do: sudo firewall-cmd --add-port=8000/tcp --permanent @@ -164,7 +176,7 @@ Kimchi uses by default the ports 8000, 8001 and 64667. To allow incoming connect 2. SELinux -Allow httpd_t context for Kimchi web server: +Allow httpd_t context for Wok web server: semanage permissive -a httpd_t @@ -172,6 +184,7 @@ Allow httpd_t context for Kimchi web server: Test ---- + $ cd plugins/kimchi $ make check-local # check for i18n and formatting errors $ sudo make check @@ -183,9 +196,9 @@ Usage Connect your browser to https://localhost:8001. You should see a screen like: -![Kimchi Login Screen](/docs/kimchi-login.png) +![Wok Login Screen](/docs/kimchi-login.png) -Kimchi uses PAM to authenticate users so you can log in with the same username +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: -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:40 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:40 -0300 Subject: [Kimchi-devel] [PATCH V3 08/34] Update wok build files In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-9-git-send-email-luciojhc@linux.vnet.ibm.com> Update autoconf and all build files to the new directory structure Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- .gitignore | 18 +++--- Makefile.am | 91 +++++++++++++++---------------- configure.ac | 38 +++---------- contrib/Makefile.am | 12 ++-- docs/Makefile.am | 9 +-- plugins/Makefile.am | 2 +- po/Makevars | 2 +- po/POTFILES.in | 3 +- po/gen-pot.in | 2 +- src/Makefile.am | 24 ++++---- src/nginx/Makefile.am | 6 +- src/wok/Makefile.am | 18 +++--- src/wok/config.py.in | 2 +- src/wok/control/Makefile.am | 4 +- src/wok/model/Makefile.am | 2 +- src/wok/xmlutils/Makefile.am | 2 +- ui/Makefile.am | 4 +- ui/css/Makefile.am | 2 +- ui/images/Makefile.am | 4 +- ui/images/theme-default/Makefile.am | 2 +- ui/js/Makefile.am | 8 ++-- ui/libs/Makefile.am | 2 +- ui/libs/themes/base/Makefile.am | 2 +- ui/libs/themes/base/images/Makefile.am | 2 +- ui/pages/Makefile.am | 4 +- ui/pages/websockify/Makefile.am | 2 +- 26 files changed, 118 insertions(+), 149 deletions(-) diff --git a/.gitignore b/.gitignore index b3988b6..a9bbc16 100644 --- a/.gitignore +++ b/.gitignore @@ -18,19 +18,20 @@ configure config.log config.status contrib/DEBIAN/control -contrib/kimchi.spec.fedora -contrib/kimchi.spec.suse +contrib/wok.spec.fedora +contrib/wok.spec.suse contrib/make-deb.sh -docs/kimchid.8 +docs/wokd.8 *.min.css *.min.js *.gmo stamp-po -kimchi-*.tar.gz -src/kimchid -src/kimchi.conf -src/nginx/kimchi.conf -src/kimchi/config.py +wok-*.tar.gz +wok.spec +src/wokd +src/wok.conf +src/nginx/wok.conf +src/wok/config.py tests/run_tests.sh tests/test_config.py plugins/sample/po/POTFILES @@ -40,4 +41,3 @@ po/gen-pot *.orig *.rej *.pem -ui/pages/help/*/*.html diff --git a/Makefile.am b/Makefile.am index 0e6e59e..dfc7576 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,9 +16,9 @@ # 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 -SUBDIRS = src ui docs contrib tests po config plugins +SUBDIRS = src ui docs contrib po plugins -man_MANS = docs/kimchid.8 +man_MANS = docs/wokd.8 AUTOMAKE_OPTIONS = foreign @@ -35,12 +35,12 @@ EXTRA_DIST = \ $(NULL) -PEP8_BLACKLIST = *src/kimchi/config.py,*src/kimchi/i18n.py,*tests/test_config.py +PEP8_BLACKLIST = *src/wok/config.py,*src/wok/i18n.py -SKIP_PYFLAKES_ERR = "\./src/kimchi/websocket\.py" +SKIP_PYFLAKES_ERR = "\./src/wok/websocket\.py" I18N_FILES = plugins/*/i18n.py \ - src/kimchi/i18n.py \ + src/wok/i18n.py \ $(NULL) check-local: @@ -60,7 +60,7 @@ all-local: while read L && test -n "$$L"; do \ dir=mo/$$L/LC_MESSAGES ; \ $(MKDIR_P) $$dir ; \ - ln -sf ../../../po/$$L.gmo $$dir/kimchi.mo ; \ + ln -sf ../../../po/$$L.gmo $$dir/wok.mo ; \ done < po/LINGUAS # @@ -69,44 +69,41 @@ all-local: 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/vnc-tokens - mkdir -p $(DESTDIR)/var/lib/kimchi/isos - touch $(DESTDIR)/var/lib/kimchi/objectstore + mkdir -p $(DESTDIR)/var/lib/wok/vnc-tokens + touch $(DESTDIR)/var/lib/wok/objectstore $(MKDIR_P) $(DESTDIR)/etc/init $(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services - cp -R $(top_srcdir)/contrib/kimchid-upstart.conf.debian \ - $(DESTDIR)/etc/init/kimchid.conf + cp -R $(top_srcdir)/contrib/wokd-upstart.conf.debian \ + $(DESTDIR)/etc/init/wokd.conf cp -R $(top_srcdir)/src/firewalld.xml \ - $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml + $(DESTDIR)/usr/lib/firewalld/services/wokd.xml deb: contrib/make-deb.sh $(top_srcdir)/contrib/make-deb.sh -kimchi.spec: contrib/kimchi.spec.fedora contrib/kimchi.spec.suse +wok.spec: contrib/wok.spec.fedora contrib/wok.spec.suse @if test -e /etc/redhat-release; then \ - ln -sf contrib/kimchi.spec.fedora $@ ; \ + ln -sf contrib/wok.spec.fedora $@ ; \ elif test -e /etc/SuSE-release; then \ - ln -sf contrib/kimchi.spec.suse $@ ; \ + ln -sf contrib/wok.spec.suse $@ ; \ else \ echo "Unable to select a spec file for RPM build" ; \ /bin/false ; \ fi -rpm: dist kimchi.spec +rpm: dist wok.spec $(MKDIR_P) rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS - cp $(top_srcdir)/kimchi.spec rpm/SPECS/kimchi.spec + cp $(top_srcdir)/wok.spec rpm/SPECS/wok.spec cp $(DIST_ARCHIVES) rpm/SOURCES - rpmbuild -ba --define "_topdir `pwd`/rpm" rpm/SPECS/kimchi.spec + rpmbuild -ba --define "_topdir `pwd`/rpm" rpm/SPECS/wok.spec -fedora-rpm: contrib/kimchi.spec.fedora - ln -sf contrib/kimchi.spec.fedora kimchi.spec +fedora-rpm: contrib/wok.spec.fedora + ln -sf contrib/wok.spec.fedora wok.spec $(MAKE) rpm -suse-rpm: contrib/kimchi.spec.suse - ln -sf contrib/kimchi.spec.suse kimchi.spec +suse-rpm: contrib/wok.spec.suse + ln -sf contrib/wok.spec.suse wok.spec $(MAKE) rpm ChangeLog: @@ -117,39 +114,39 @@ ChangeLog: install-data-local: @if test -d "$(systemdsystemunitdir)" ; then \ mkdir -p $(DESTDIR)/$(systemdsystemunitdir); \ - $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/$(systemdsystemunitdir)/kimchid.service; \ + $(INSTALL_DATA) contrib/wokd.service.fedora $(DESTDIR)/$(systemdsystemunitdir)/wokd.service; \ else \ mkdir -p $(DESTDIR)/etc/init.d/; \ - $(INSTALL_DATA) contrib/kimchid.sysvinit $(DESTDIR)/etc/init.d/kimchid; \ - chmod +x $(DESTDIR)/etc/init.d/kimchid; \ + $(INSTALL_DATA) contrib/wokd.sysvinit $(DESTDIR)/etc/init.d/wokd; \ + chmod +x $(DESTDIR)/etc/init.d/wokd; \ fi; \ if test -d /usr/lib/firewalld/services/; then \ mkdir -p $(DESTDIR)/usr/lib/firewalld/services/; \ - $(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \ + $(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/wokd.xml; \ fi; \ - mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos} - touch $(DESTDIR)/var/lib/kimchi/objectstore - mkdir -p $(DESTDIR)/var/log/kimchi/ - touch $(DESTDIR)/var/log/kimchi/kimchi-access.log - touch $(DESTDIR)/var/log/kimchi/kimchi-error.log - mkdir -p $(DESTDIR)/etc/kimchi/ - $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/kimchi/dhparams.pem - touch $(DESTDIR)/etc/nginx/conf.d/kimchi.conf + mkdir -p $(DESTDIR)/var/lib/wok/vnc-tokens + touch $(DESTDIR)/var/lib/wok/objectstore + mkdir -p $(DESTDIR)/var/log/wok/ + touch $(DESTDIR)/var/log/wok/wok-access.log + touch $(DESTDIR)/var/log/wok/wok-error.log + mkdir -p $(DESTDIR)/etc/wok/ + $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/wok/dhparams.pem + touch $(DESTDIR)/etc/nginx/conf.d/wok.conf uninstall-local: - @if test -f $(systemdsystemunitdir)/kimchid.service; then \ - $(RM) $(DESTDIR)/$(systemdsystemunitdir)/kimchid.service; \ - elif test -f /etc/init.d/kimchid; then \ - $(RM) $(DESTDIR)/etc/init.d/kimchid; \ - $(RM) $(DESTDIR)/etc/init/kimchi.conf; \ + @if test -f $(systemdsystemunitdir)/wokd.service; then \ + $(RM) $(DESTDIR)/$(systemdsystemunitdir)/wokd.service; \ + elif test -f /etc/init.d/wokd; then \ + $(RM) $(DESTDIR)/etc/init.d/wokd; \ + $(RM) $(DESTDIR)/etc/init/wok.conf; \ fi; \ if test -d /usr/lib/firewalld/services/; then \ - $(RM) $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \ + $(RM) $(DESTDIR)/usr/lib/firewalld/services/wokd.xml; \ fi; \ - $(RM) -rf $(DESTDIR)/var/lib/kimchi - $(RM) -rf $(DESTDIR)/var/log/kimchi - $(RM) -rf $(DESTDIR)/etc/kimchi - $(RM) $(DESTDIR)/etc/nginx/conf.d/kimchi.conf + $(RM) -rf $(DESTDIR)/var/lib/wok + $(RM) -rf $(DESTDIR)/var/log/wok + $(RM) -rf $(DESTDIR)/etc/wok + $(RM) $(DESTDIR)/etc/nginx/conf.d/wok.conf VERSION: @if test -d .git; then \ @@ -162,4 +159,4 @@ VERSION: clean-local: rm -rf mo rpm -CLEANFILES = kimchi.spec `find "$(top_srcdir)" -type f -name "*.pyc" -print` +CLEANFILES = wok.spec `find "$(top_srcdir)" -type f -name "*.pyc" -print` diff --git a/configure.ac b/configure.ac index 9e3edb8..47c2e6c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -AC_INIT([kimchi], [m4_esyscmd([./build-aux/pkg-version --version])]) +AC_INIT([wok], [m4_esyscmd([./build-aux/pkg-version --version])]) AC_SUBST([PACKAGE_VERSION], [m4_esyscmd([./build-aux/pkg-version --version])]) @@ -87,15 +87,13 @@ AC_CONFIG_FILES([ po/gen-pot Makefile docs/Makefile - docs/kimchid.8 + docs/wokd.8 src/Makefile - src/distros.d/Makefile src/nginx/Makefile - src/kimchi/Makefile - src/kimchi/control/Makefile - src/kimchi/control/vm/Makefile - src/kimchi/model/Makefile - src/kimchi/xmlutils/Makefile + src/wok/Makefile + src/wok/control/Makefile + src/wok/model/Makefile + src/wok/xmlutils/Makefile plugins/Makefile plugins/sample/Makefile plugins/sample/po/Makefile.in @@ -112,37 +110,17 @@ AC_CONFIG_FILES([ ui/images/Makefile ui/images/theme-default/Makefile ui/js/Makefile - ui/spice-html5/Makefile - ui/spice-html5/css/Makefile - ui/spice-html5/pages/Makefile - ui/spice-html5/thirdparty/Makefile ui/libs/Makefile ui/libs/themes/Makefile ui/libs/themes/base/Makefile ui/libs/themes/base/images/Makefile ui/pages/Makefile - ui/pages/help/Makefile - ui/pages/help/en_US/Makefile - ui/pages/help/de_DE/Makefile - ui/pages/help/es_ES/Makefile - ui/pages/help/fr_FR/Makefile - ui/pages/help/it_IT/Makefile - ui/pages/help/ja_JP/Makefile - ui/pages/help/ko_KR/Makefile - ui/pages/help/pt_BR/Makefile - ui/pages/help/ru_RU/Makefile - ui/pages/help/zh_CN/Makefile - ui/pages/help/zh_TW/Makefile - ui/pages/tabs/Makefile ui/pages/websockify/Makefile contrib/Makefile contrib/DEBIAN/Makefile contrib/DEBIAN/control - contrib/kimchi.spec.fedora - contrib/kimchi.spec.suse - tests/Makefile - config/Makefile - config/ui/Makefile + contrib/wok.spec.fedora + contrib/wok.spec.suse ],[ chmod +x po/gen-pot ]) diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 393306f..b537df5 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -18,11 +18,11 @@ SUBDIRS = DEBIAN EXTRA_DIST = \ check_i18n.py \ - kimchid.sysvinit \ - kimchid.service.fedora \ - kimchi.spec.fedora.in \ - kimchid-upstart.conf.debian \ - kimchid-upstart.conf.fedora \ + wokd.sysvinit \ + wokd.service.fedora \ + wok.spec.fedora.in \ + wokd-upstart.conf.debian \ + wokd-upstart.conf.fedora \ make-deb.sh.in \ $(NULL) @@ -35,4 +35,4 @@ make-deb.sh: make-deb.sh.in $(top_builddir)/config.status mv $@-t $@ BUILT_SOURCES = make-deb.sh -CLEANFILES = kimchi.spec.fedora kimchi.spec.suse kimchi.spec make-deb.sh +CLEANFILES = wok.spec.fedora wok.spec.suse wok.spec make-deb.sh diff --git a/docs/Makefile.am b/docs/Makefile.am index 2f686f1..db23721 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -17,15 +17,12 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -docdir = $(datadir)/kimchi/doc +docdir = $(datadir)/wok/doc dist_doc_DATA = \ API.md \ README.md \ - README-federation.md \ - kimchi-guest.png \ - kimchi-templates.png \ - kimchid.8 \ + wokd.8 \ $(NULL) -CLEANFILES = kimchid.8 +CLEANFILES = wokd.8 diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 894d28e..21a6ece 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -22,4 +22,4 @@ SUBDIRS = sample plugins_PYTHON = \ __init__.py -pluginsdir = $(pythondir)/kimchi/plugins +pluginsdir = $(pythondir)/wok/plugins diff --git a/po/Makevars b/po/Makevars index c29a807..e135764 100644 --- a/po/Makevars +++ b/po/Makevars @@ -1,7 +1,7 @@ # Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. -DOMAIN = kimchi +DOMAIN = wok # These two variables depend on the location of this directory. subdir = po diff --git a/po/POTFILES.in b/po/POTFILES.in index 57bc711..aae0ca9 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,3 @@ # List of source files which contain translatable strings. -src/kimchi/i18n.py +src/wok/i18n.py ui/pages/*.tmpl -ui/pages/tabs/*.tmpl diff --git a/po/gen-pot.in b/po/gen-pot.in index 0e3cd10..7ccf28b 100644 --- a/po/gen-pot.in +++ b/po/gen-pot.in @@ -6,4 +6,4 @@ for src in $@; do else cat $src | @CHEETAH@ compile - fi -done | xgettext --no-location -o kimchi.pot -L Python - +done | xgettext --no-location -o wok.pot -L Python - diff --git a/src/Makefile.am b/src/Makefile.am index e0e0821..2fed7d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,19 +17,19 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -SUBDIRS = kimchi distros.d nginx +SUBDIRS = wok nginx -EXTRA_DIST = kimchid.in \ - kimchi.conf.in \ +EXTRA_DIST = wokd.in \ + wok.conf.in \ firewalld.xml \ $(NULL) -bin_SCRIPTS = kimchid +bin_SCRIPTS = wokd -confdir = $(sysconfdir)/kimchi -dist_conf_DATA = kimchi.conf template.conf +confdir = $(sysconfdir)/wok +dist_conf_DATA = wok.conf -BUILT_SOURCES = kimchi.conf +BUILT_SOURCES = wok.conf do_substitution = \ sed -e 's,[@]pythondir[@],$(pythondir),g' \ @@ -38,12 +38,12 @@ do_substitution = \ -e 's,[@]VERSION[@],$(VERSION),g' -kimchid: kimchid.in Makefile - $(do_substitution) < $(srcdir)/kimchid.in > kimchid - chmod +x kimchid +wokd: wokd.in Makefile + $(do_substitution) < $(srcdir)/wokd.in > wokd + chmod +x wokd -kimchi.conf: kimchi.conf.in Makefile - $(do_substitution) < kimchi.conf.in > kimchi.conf +wok.conf: wok.conf.in Makefile + $(do_substitution) < wok.conf.in > wok.conf # Generate unique Diffie-Hellman group with 2048-bit all-local: dhparams.pem diff --git a/src/nginx/Makefile.am b/src/nginx/Makefile.am index c754947..0f36b44 100644 --- a/src/nginx/Makefile.am +++ b/src/nginx/Makefile.am @@ -17,9 +17,9 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -EXTRA_DIST = kimchi.conf.in +EXTRA_DIST = wok.conf.in confdir = $(sysconfdir)/nginx/conf.d -dist_conf_DATA = kimchi.conf.in +dist_conf_DATA = wok.conf.in -CLEANFILES = kimchi.conf +CLEANFILES = wok.conf diff --git a/src/wok/Makefile.am b/src/wok/Makefile.am index 5c204e0..6e00907 100644 --- a/src/wok/Makefile.am +++ b/src/wok/Makefile.am @@ -19,9 +19,9 @@ SUBDIRS = control model xmlutils -kimchi_PYTHON = $(filter-out config.py, $(wildcard *.py)) +wok_PYTHON = $(filter-out config.py, $(wildcard *.py)) -nodist_kimchi_PYTHON = config.py +nodist_wok_PYTHON = config.py EXTRA_DIST = \ API.json \ @@ -33,14 +33,14 @@ else WITH_SPICE=no endif -kimchidir = $(pythondir)/kimchi +wokdir = $(pythondir)/wok install-data-local: - $(MKDIR_P) $(DESTDIR)$(kimchidir) - $(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json + $(MKDIR_P) $(DESTDIR)$(wokdir) + $(INSTALL_DATA) API.json $(DESTDIR)$(wokdir)/API.json uninstall-local: - $(RM) $(DESTDIR)$(kimchidir)/API.json + $(RM) $(DESTDIR)$(wokdir)/API.json do_substitution = \ sed -e 's,[@]prefix[@],$(prefix),g' \ @@ -48,9 +48,9 @@ do_substitution = \ -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ -e 's,[@]localstatedir[@],$(localstatedir),g' \ -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ - -e 's,[@]kimchidir[@],$(kimchidir),g' \ - -e 's,[@]kimchiversion[@],$(PACKAGE_VERSION),g' \ - -e 's,[@]kimchirelease[@],$(PACKAGE_RELEASE),g' \ + -e 's,[@]wokdir[@],$(wokdir),g' \ + -e 's,[@]wokversion[@],$(PACKAGE_VERSION),g' \ + -e 's,[@]wokrelease[@],$(PACKAGE_RELEASE),g' \ -e 's,[@]withspice[@],$(WITH_SPICE),g' diff --git a/src/wok/config.py.in b/src/wok/config.py.in index d2c5169..1408024 100644 --- a/src/wok/config.py.in +++ b/src/wok/config.py.in @@ -136,7 +136,7 @@ class Paths(object): else: base = os.path.dirname('./%s' % __file__) - if os.access('%s/../../src/kimchi/config.py' % base, os.F_OK): + if os.access('%s/../../src/wok/config.py' % base, os.F_OK): return os.path.abspath('%s/../..' % base) else: return '@pkgdatadir@' diff --git a/src/wok/control/Makefile.am b/src/wok/control/Makefile.am index fee98dc..d6cb3f0 100644 --- a/src/wok/control/Makefile.am +++ b/src/wok/control/Makefile.am @@ -17,11 +17,9 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -SUBDIRS = vm - control_PYTHON = *.py -controldir = $(pythondir)/kimchi/control +controldir = $(pythondir)/wok/control install-data-local: $(MKDIR_P) $(DESTDIR)$(controldir) diff --git a/src/wok/model/Makefile.am b/src/wok/model/Makefile.am index a6ccbf0..8f0f102 100644 --- a/src/wok/model/Makefile.am +++ b/src/wok/model/Makefile.am @@ -19,7 +19,7 @@ model_PYTHON = *.py -modeldir = $(pythondir)/kimchi/model +modeldir = $(pythondir)/wok/model install-data-local: $(MKDIR_P) $(DESTDIR)$(modeldir) diff --git a/src/wok/xmlutils/Makefile.am b/src/wok/xmlutils/Makefile.am index 73f86f4..69aa524 100644 --- a/src/wok/xmlutils/Makefile.am +++ b/src/wok/xmlutils/Makefile.am @@ -19,7 +19,7 @@ xmlutils_PYTHON = *.py -xmlutilsdir = $(pythondir)/kimchi/xmlutils +xmlutilsdir = $(pythondir)/wok/xmlutils install-data-local: $(MKDIR_P) $(DESTDIR)$(xmlutilsdir) diff --git a/ui/Makefile.am b/ui/Makefile.am index adb6ada..6be27ed 100644 --- a/ui/Makefile.am +++ b/ui/Makefile.am @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = css fontello images js libs pages spice-html5 +SUBDIRS = css fontello images js libs pages -uidir = $(datadir)/kimchi/ui +uidir = $(datadir)/wok/ui dist_ui_DATA = robots.txt diff --git a/ui/css/Makefile.am b/ui/css/Makefile.am index f4f3dac..29ddb26 100644 --- a/ui/css/Makefile.am +++ b/ui/css/Makefile.am @@ -17,7 +17,7 @@ EXTRA_DIST = theme-default -cssdir = $(datadir)/kimchi/ui/css +cssdir = $(datadir)/wok/ui/css dist_css_DATA = theme-default.min.css theme-default.min.css: theme-default/*.css diff --git a/ui/images/Makefile.am b/ui/images/Makefile.am index 7b63d23..297c0bd 100644 --- a/ui/images/Makefile.am +++ b/ui/images/Makefile.am @@ -17,6 +17,6 @@ SUBDIRS = theme-default -imagedir = $(datadir)/kimchi/ui/images +imagedir = $(datadir)/wok/ui/images -dist_image_DATA = *.png *.ico +dist_image_DATA = *.ico diff --git a/ui/images/theme-default/Makefile.am b/ui/images/theme-default/Makefile.am index 7c69b2a..336729c 100644 --- a/ui/images/theme-default/Makefile.am +++ b/ui/images/theme-default/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -imagedir = $(datadir)/kimchi/ui/images/theme-default +imagedir = $(datadir)/wok/ui/images/theme-default dist_image_DATA = *.png *.gif diff --git a/ui/js/Makefile.am b/ui/js/Makefile.am index d0653b9..2549846 100644 --- a/ui/js/Makefile.am +++ b/ui/js/Makefile.am @@ -17,11 +17,11 @@ EXTRA_DIST = src widgets -jsdir = $(datadir)/kimchi/ui/js +jsdir = $(datadir)/wok/ui/js -dist_js_DATA = kimchi.min.js $(filter-out kimchi.min.js, $(wildcard *.js)) +dist_js_DATA = wok.min.js $(filter-out wok.min.js, $(wildcard *.js)) -kimchi.min.js: widgets/*.js src/*.js +wok.min.js: widgets/*.js src/*.js cat $(sort $^) > $@ -CLEANFILES = kimchi.min.js +CLEANFILES = wok.min.js diff --git a/ui/libs/Makefile.am b/ui/libs/Makefile.am index a2acce2..49ad3bb 100644 --- a/ui/libs/Makefile.am +++ b/ui/libs/Makefile.am @@ -17,6 +17,6 @@ SUBDIRS = themes -jsdir = $(datadir)/kimchi/ui/libs +jsdir = $(datadir)/wok/ui/libs dist_js_DATA = $(wildcard *.js) $(NULL) diff --git a/ui/libs/themes/base/Makefile.am b/ui/libs/themes/base/Makefile.am index d7454f0..1bbaa50 100644 --- a/ui/libs/themes/base/Makefile.am +++ b/ui/libs/themes/base/Makefile.am @@ -17,6 +17,6 @@ SUBDIRS = images -basedir = $(datadir)/kimchi/ui/libs/themes/base +basedir = $(datadir)/wok/ui/libs/themes/base dist_base_DATA = $(wildcard *.css) $(NULL) diff --git a/ui/libs/themes/base/images/Makefile.am b/ui/libs/themes/base/images/Makefile.am index 6afec8b..dd619c8 100644 --- a/ui/libs/themes/base/images/Makefile.am +++ b/ui/libs/themes/base/images/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -imagesdir = $(datadir)/kimchi/ui/libs/themes/base/images +imagesdir = $(datadir)/wok/ui/libs/themes/base/images dist_images_DATA = *.png diff --git a/ui/pages/Makefile.am b/ui/pages/Makefile.am index a22afc1..68f4c92 100644 --- a/ui/pages/Makefile.am +++ b/ui/pages/Makefile.am @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = help tabs websockify +SUBDIRS = websockify -htmldir = $(datadir)/kimchi/ui/pages +htmldir = $(datadir)/wok/ui/pages dist_html_DATA = $(wildcard *.tmpl) $(NULL) diff --git a/ui/pages/websockify/Makefile.am b/ui/pages/websockify/Makefile.am index d498242..5321562 100644 --- a/ui/pages/websockify/Makefile.am +++ b/ui/pages/websockify/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -websockifyhtmldir = $(datadir)/kimchi/ui/pages/websockify +websockifyhtmldir = $(datadir)/wok/ui/pages/websockify dist_websockifyhtml_DATA = $(wildcard *.html) $(NULL) -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:41 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:41 -0300 Subject: [Kimchi-devel] [PATCH V3 09/34] Update kimchi plugin makefiles In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-10-git-send-email-luciojhc@linux.vnet.ibm.com> - Reflect new plugin structure in all base files. - Add kimchi plugin specifics (spice, config.py) - Remove wok specifics Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/.gitignore | 8 +-- plugins/kimchi/Makefile.am | 94 +++++++++----------- plugins/kimchi/configure.ac | 43 ++-------- plugins/kimchi/contrib/Makefile.am | 4 - plugins/kimchi/control/Makefile.am | 2 +- plugins/kimchi/control/vm/Makefile.am | 2 +- plugins/kimchi/docs/Makefile.am | 3 - plugins/kimchi/model/Makefile.am | 2 +- plugins/kimchi/po/POTFILES.in | 3 +- plugins/kimchi/tests/Makefile.am | 2 +- plugins/kimchi/ui/Makefile.am | 4 +- plugins/kimchi/ui/config/Makefile.am | 4 +- plugins/kimchi/ui/css/Makefile.am | 2 +- plugins/kimchi/ui/images/Makefile.am | 2 +- plugins/kimchi/ui/images/theme-default/Makefile.am | 2 +- plugins/kimchi/ui/js/Makefile.am | 6 +- plugins/kimchi/ui/pages/Makefile.am | 4 +- plugins/kimchi/ui/pages/help/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/de_DE/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/en_US/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/es_ES/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/fr_FR/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/it_IT/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/ja_JP/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/ko_KR/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/pt_BR/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/ru_RU/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/zh_CN/Makefile.am | 2 +- plugins/kimchi/ui/pages/help/zh_TW/Makefile.am | 2 +- plugins/kimchi/ui/pages/tabs/Makefile.am | 2 +- plugins/kimchi/ui/spice-html5/Makefile.am | 2 +- plugins/kimchi/ui/spice-html5/css/Makefile.am | 2 +- plugins/kimchi/ui/spice-html5/pages/Makefile.am | 2 +- .../kimchi/ui/spice-html5/thirdparty/Makefile.am | 2 +- plugins/kimchi/xmlutils/Makefile.am | 2 +- 35 files changed, 87 insertions(+), 136 deletions(-) diff --git a/plugins/kimchi/.gitignore b/plugins/kimchi/.gitignore index b3988b6..1dae610 100644 --- a/plugins/kimchi/.gitignore +++ b/plugins/kimchi/.gitignore @@ -16,25 +16,19 @@ build-aux/missing build-aux/py-compile configure config.log +config.py config.status contrib/DEBIAN/control contrib/kimchi.spec.fedora contrib/kimchi.spec.suse contrib/make-deb.sh -docs/kimchid.8 *.min.css *.min.js *.gmo stamp-po kimchi-*.tar.gz -src/kimchid -src/kimchi.conf -src/nginx/kimchi.conf -src/kimchi/config.py tests/run_tests.sh tests/test_config.py -plugins/sample/po/POTFILES -plugins/sample/sample.conf po/POTFILES po/gen-pot *.orig diff --git a/plugins/kimchi/Makefile.am b/plugins/kimchi/Makefile.am index 0e6e59e..faef341 100644 --- a/plugins/kimchi/Makefile.am +++ b/plugins/kimchi/Makefile.am @@ -16,9 +16,24 @@ # 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 -SUBDIRS = src ui docs contrib tests po config plugins -man_MANS = docs/kimchid.8 +SUBDIRS = contrib control distros.d docs model po tests ui xmlutils + +kimchi_PYTHON = $(filter-out config.py, $(wildcard *.py)) + +nodist_kimchi_PYTHON = config.py + +if WITH_SPICE +WITH_SPICE=yes +else +WITH_SPICE=no +endif + +wokdir = $(pythondir)/wok +kimchidir = $(pythondir)/wok/plugins/kimchi + +confdir = $(sysconfdir)/wok/plugins.d +dist_conf_DATA = kimchi.conf template.conf AUTOMAKE_OPTIONS = foreign @@ -26,28 +41,26 @@ ACLOCAL_AMFLAGS = --install -I m4 EXTRA_DIST = \ config.rpath \ + API.json \ autogen.sh \ COPYING.ASL2 \ COPYING.LGPL \ CONTRIBUTE.md \ VERSION \ build-aux/pkg-version \ + config.py.in \ $(NULL) -PEP8_BLACKLIST = *src/kimchi/config.py,*src/kimchi/i18n.py,*tests/test_config.py +PEP8_BLACKLIST = *config.py,*i18n.py,*tests/test_config.py -SKIP_PYFLAKES_ERR = "\./src/kimchi/websocket\.py" - -I18N_FILES = plugins/*/i18n.py \ - src/kimchi/i18n.py \ +I18N_FILES = ./i18n.py \ $(NULL) check-local: - PYTHONPATH=src contrib/check_i18n.py $(I18N_FILES) + contrib/check_i18n.py $(I18N_FILES) find . -path './.git' -prune -type f -o \ -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) | \ - grep -w -v $(SKIP_PYFLAKES_ERR) | \ while read LINE; do echo "$$LINE"; false; done $(PEP8) --version @@ -63,6 +76,22 @@ all-local: ln -sf ../../../po/$$L.gmo $$dir/kimchi.mo ; \ done < po/LINGUAS +do_substitution = \ + sed -e 's,[@]prefix[@],$(prefix),g' \ + -e 's,[@]datadir[@],$(datadir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]localstatedir[@],$(localstatedir),g' \ + -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ + -e 's,[@]wokdir[@],$(wokdir),g' \ + -e 's,[@]kimchidir[@],$(kimchidir),g' \ + -e 's,[@]kimchiversion[@],$(PACKAGE_VERSION),g' \ + -e 's,[@]kimchirelease[@],$(PACKAGE_RELEASE),g' \ + -e 's,[@]withspice[@],$(WITH_SPICE),g' + +config.py: config.py.in Makefile + $(do_substitution) < $(srcdir)/config.py.in > config.py + + # # Packaging helpers # @@ -71,15 +100,7 @@ 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/vnc-tokens mkdir -p $(DESTDIR)/var/lib/kimchi/isos - touch $(DESTDIR)/var/lib/kimchi/objectstore - $(MKDIR_P) $(DESTDIR)/etc/init - $(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services - cp -R $(top_srcdir)/contrib/kimchid-upstart.conf.debian \ - $(DESTDIR)/etc/init/kimchid.conf - cp -R $(top_srcdir)/src/firewalld.xml \ - $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml deb: contrib/make-deb.sh @@ -115,41 +136,13 @@ ChangeLog: fi install-data-local: - @if test -d "$(systemdsystemunitdir)" ; then \ - mkdir -p $(DESTDIR)/$(systemdsystemunitdir); \ - $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/$(systemdsystemunitdir)/kimchid.service; \ - else \ - mkdir -p $(DESTDIR)/etc/init.d/; \ - $(INSTALL_DATA) contrib/kimchid.sysvinit $(DESTDIR)/etc/init.d/kimchid; \ - chmod +x $(DESTDIR)/etc/init.d/kimchid; \ - fi; \ - if test -d /usr/lib/firewalld/services/; then \ - mkdir -p $(DESTDIR)/usr/lib/firewalld/services/; \ - $(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \ - fi; \ - mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos} - touch $(DESTDIR)/var/lib/kimchi/objectstore - mkdir -p $(DESTDIR)/var/log/kimchi/ - touch $(DESTDIR)/var/log/kimchi/kimchi-access.log - touch $(DESTDIR)/var/log/kimchi/kimchi-error.log - mkdir -p $(DESTDIR)/etc/kimchi/ - $(INSTALL_DATA) src/dhparams.pem $(DESTDIR)/etc/kimchi/dhparams.pem - touch $(DESTDIR)/etc/nginx/conf.d/kimchi.conf + $(MKDIR_P) $(DESTDIR)$(kimchidir) + $(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json + mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,isos} uninstall-local: - @if test -f $(systemdsystemunitdir)/kimchid.service; then \ - $(RM) $(DESTDIR)/$(systemdsystemunitdir)/kimchid.service; \ - elif test -f /etc/init.d/kimchid; then \ - $(RM) $(DESTDIR)/etc/init.d/kimchid; \ - $(RM) $(DESTDIR)/etc/init/kimchi.conf; \ - fi; \ - if test -d /usr/lib/firewalld/services/; then \ - $(RM) $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \ - fi; \ + $(RM) $(DESTDIR)$(kimchidir)/API.json $(RM) -rf $(DESTDIR)/var/lib/kimchi - $(RM) -rf $(DESTDIR)/var/log/kimchi - $(RM) -rf $(DESTDIR)/etc/kimchi - $(RM) $(DESTDIR)/etc/nginx/conf.d/kimchi.conf VERSION: @if test -d .git; then \ @@ -162,4 +155,5 @@ VERSION: clean-local: rm -rf mo rpm -CLEANFILES = kimchi.spec `find "$(top_srcdir)" -type f -name "*.pyc" -print` +BUILT_SOURCES = config.py +CLEANFILES = config.py kimchi.spec `find "$(top_srcdir)" -type f -name "*.pyc" -print` diff --git a/plugins/kimchi/configure.ac b/plugins/kimchi/configure.ac index 9e3edb8..adab45b 100644 --- a/plugins/kimchi/configure.ac +++ b/plugins/kimchi/configure.ac @@ -64,15 +64,6 @@ else AC_SUBST([ENABLE_SAMPLE], [False]) fi -# check for systemd -PKG_PROG_PKG_CONFIG -AC_ARG_WITH([systemdsystemunitdir], - AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), - [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) -if test "x$with_systemdsystemunitdir" != xno; then - AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) -fi - AC_ARG_WITH( [spice-html5], [AS_HELP_STRING([--with-spice-html5], @@ -87,28 +78,13 @@ AC_CONFIG_FILES([ po/gen-pot Makefile docs/Makefile - docs/kimchid.8 - src/Makefile - src/distros.d/Makefile - src/nginx/Makefile - src/kimchi/Makefile - src/kimchi/control/Makefile - src/kimchi/control/vm/Makefile - src/kimchi/model/Makefile - src/kimchi/xmlutils/Makefile - plugins/Makefile - plugins/sample/Makefile - plugins/sample/po/Makefile.in - plugins/sample/sample.conf - plugins/sample/ui/Makefile - plugins/sample/ui/config/Makefile - plugins/sample/ui/js/Makefile - plugins/sample/ui/pages/Makefile + distros.d/Makefile + control/Makefile + control/vm/Makefile + model/Makefile ui/Makefile + ui/config/Makefile ui/css/Makefile - ui/fontello/Makefile - ui/fontello/css/Makefile - ui/fontello/font/Makefile ui/images/Makefile ui/images/theme-default/Makefile ui/js/Makefile @@ -116,10 +92,6 @@ AC_CONFIG_FILES([ ui/spice-html5/css/Makefile ui/spice-html5/pages/Makefile ui/spice-html5/thirdparty/Makefile - ui/libs/Makefile - ui/libs/themes/Makefile - ui/libs/themes/base/Makefile - ui/libs/themes/base/images/Makefile ui/pages/Makefile ui/pages/help/Makefile ui/pages/help/en_US/Makefile @@ -133,16 +105,13 @@ AC_CONFIG_FILES([ ui/pages/help/ru_RU/Makefile ui/pages/help/zh_CN/Makefile ui/pages/help/zh_TW/Makefile - ui/pages/tabs/Makefile - ui/pages/websockify/Makefile contrib/Makefile contrib/DEBIAN/Makefile contrib/DEBIAN/control contrib/kimchi.spec.fedora contrib/kimchi.spec.suse tests/Makefile - config/Makefile - config/ui/Makefile + xmlutils/Makefile ],[ chmod +x po/gen-pot ]) diff --git a/plugins/kimchi/contrib/Makefile.am b/plugins/kimchi/contrib/Makefile.am index 393306f..5001191 100644 --- a/plugins/kimchi/contrib/Makefile.am +++ b/plugins/kimchi/contrib/Makefile.am @@ -18,11 +18,7 @@ SUBDIRS = DEBIAN EXTRA_DIST = \ check_i18n.py \ - kimchid.sysvinit \ - kimchid.service.fedora \ kimchi.spec.fedora.in \ - kimchid-upstart.conf.debian \ - kimchid-upstart.conf.fedora \ make-deb.sh.in \ $(NULL) diff --git a/plugins/kimchi/control/Makefile.am b/plugins/kimchi/control/Makefile.am index fee98dc..33118ca 100644 --- a/plugins/kimchi/control/Makefile.am +++ b/plugins/kimchi/control/Makefile.am @@ -21,7 +21,7 @@ SUBDIRS = vm control_PYTHON = *.py -controldir = $(pythondir)/kimchi/control +controldir = $(pythondir)/wok/plugins/kimchi/control install-data-local: $(MKDIR_P) $(DESTDIR)$(controldir) diff --git a/plugins/kimchi/control/vm/Makefile.am b/plugins/kimchi/control/vm/Makefile.am index e57b907..b17c68a 100644 --- a/plugins/kimchi/control/vm/Makefile.am +++ b/plugins/kimchi/control/vm/Makefile.am @@ -20,7 +20,7 @@ vm_PYTHON = *.py -vmdir = $(pythondir)/kimchi/control/vm +vmdir = $(pythondir)/wok/plugins/kimchi/control/vm install-data-local: $(MKDIR_P) $(DESTDIR)$(vmdir) diff --git a/plugins/kimchi/docs/Makefile.am b/plugins/kimchi/docs/Makefile.am index 2f686f1..679aa18 100644 --- a/plugins/kimchi/docs/Makefile.am +++ b/plugins/kimchi/docs/Makefile.am @@ -25,7 +25,4 @@ dist_doc_DATA = \ README-federation.md \ kimchi-guest.png \ kimchi-templates.png \ - kimchid.8 \ $(NULL) - -CLEANFILES = kimchid.8 diff --git a/plugins/kimchi/model/Makefile.am b/plugins/kimchi/model/Makefile.am index a6ccbf0..f4f4750 100644 --- a/plugins/kimchi/model/Makefile.am +++ b/plugins/kimchi/model/Makefile.am @@ -19,7 +19,7 @@ model_PYTHON = *.py -modeldir = $(pythondir)/kimchi/model +modeldir = $(pythondir)/wok/plugins/kimchi/model install-data-local: $(MKDIR_P) $(DESTDIR)$(modeldir) diff --git a/plugins/kimchi/po/POTFILES.in b/plugins/kimchi/po/POTFILES.in index 57bc711..92eef1e 100644 --- a/plugins/kimchi/po/POTFILES.in +++ b/plugins/kimchi/po/POTFILES.in @@ -1,4 +1,3 @@ # List of source files which contain translatable strings. -src/kimchi/i18n.py +i18n.py ui/pages/*.tmpl -ui/pages/tabs/*.tmpl diff --git a/plugins/kimchi/tests/Makefile.am b/plugins/kimchi/tests/Makefile.am index 09dce6c..c1f6784 100644 --- a/plugins/kimchi/tests/Makefile.am +++ b/plugins/kimchi/tests/Makefile.am @@ -31,7 +31,7 @@ do_substitution = \ -e 's,[@]prefix[@],$(prefix),g' \ -e 's,[@]datadir[@],$(datadir),g' \ -e 's,[@]PYTHON_VERSION[@],$(PYTHON_VERSION),g' \ - -e 's,[@]kimchidir[@],$(pythondir)/kimchi,g' \ + -e 's,[@]wokdir[@],$(pythondir)/wok,g' \ -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' diff --git a/plugins/kimchi/ui/Makefile.am b/plugins/kimchi/ui/Makefile.am index 208d3e3..21fe703 100644 --- a/plugins/kimchi/ui/Makefile.am +++ b/plugins/kimchi/ui/Makefile.am @@ -15,4 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = ui +SUBDIRS = config css images js pages spice-html5 + +uidir = $(datadir)/wok/plugins/kimchi/ui diff --git a/plugins/kimchi/ui/config/Makefile.am b/plugins/kimchi/ui/config/Makefile.am index 32b74e3..e3b3d19 100644 --- a/plugins/kimchi/ui/config/Makefile.am +++ b/plugins/kimchi/ui/config/Makefile.am @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -xmldir = $(datadir)/kimchi/config/ui +xmldir = $(datadir)/wok/plugins/kimchi/ui/config dist_xml_DATA = \ - tabs.xml \ + tab-ext.xml \ $(NULL) diff --git a/plugins/kimchi/ui/css/Makefile.am b/plugins/kimchi/ui/css/Makefile.am index f4f3dac..5071d29 100644 --- a/plugins/kimchi/ui/css/Makefile.am +++ b/plugins/kimchi/ui/css/Makefile.am @@ -17,7 +17,7 @@ EXTRA_DIST = theme-default -cssdir = $(datadir)/kimchi/ui/css +cssdir = $(datadir)/wok/plugins/kimchi/ui/css dist_css_DATA = theme-default.min.css theme-default.min.css: theme-default/*.css diff --git a/plugins/kimchi/ui/images/Makefile.am b/plugins/kimchi/ui/images/Makefile.am index 7b63d23..0562e6a 100644 --- a/plugins/kimchi/ui/images/Makefile.am +++ b/plugins/kimchi/ui/images/Makefile.am @@ -17,6 +17,6 @@ SUBDIRS = theme-default -imagedir = $(datadir)/kimchi/ui/images +imagedir = $(datadir)/wok/plugins/kimchi/ui/images dist_image_DATA = *.png *.ico diff --git a/plugins/kimchi/ui/images/theme-default/Makefile.am b/plugins/kimchi/ui/images/theme-default/Makefile.am index 7c69b2a..7e11d75 100644 --- a/plugins/kimchi/ui/images/theme-default/Makefile.am +++ b/plugins/kimchi/ui/images/theme-default/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -imagedir = $(datadir)/kimchi/ui/images/theme-default +imagedir = $(datadir)/wok/plugins/kimchi/ui/images/theme-default dist_image_DATA = *.png *.gif diff --git a/plugins/kimchi/ui/js/Makefile.am b/plugins/kimchi/ui/js/Makefile.am index d0653b9..c9d1218 100644 --- a/plugins/kimchi/ui/js/Makefile.am +++ b/plugins/kimchi/ui/js/Makefile.am @@ -15,13 +15,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -EXTRA_DIST = src widgets +EXTRA_DIST = src -jsdir = $(datadir)/kimchi/ui/js +jsdir = $(datadir)/wok/plugins/kimchi/ui/js dist_js_DATA = kimchi.min.js $(filter-out kimchi.min.js, $(wildcard *.js)) -kimchi.min.js: widgets/*.js src/*.js +kimchi.min.js: src/*.js cat $(sort $^) > $@ CLEANFILES = kimchi.min.js diff --git a/plugins/kimchi/ui/pages/Makefile.am b/plugins/kimchi/ui/pages/Makefile.am index a22afc1..076b814 100644 --- a/plugins/kimchi/ui/pages/Makefile.am +++ b/plugins/kimchi/ui/pages/Makefile.am @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = help tabs websockify +SUBDIRS = help tabs -htmldir = $(datadir)/kimchi/ui/pages +htmldir = $(datadir)/wok/plugins/kimchi/ui/pages dist_html_DATA = $(wildcard *.tmpl) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/Makefile.am b/plugins/kimchi/ui/pages/help/Makefile.am index 5c04319..0fbe47b 100644 --- a/plugins/kimchi/ui/pages/help/Makefile.am +++ b/plugins/kimchi/ui/pages/help/Makefile.am @@ -22,7 +22,7 @@ DITA_XSL_FILE = dita-help.xsl EXTRA_DIST = gen-index.py\ $(DITA_XSL_FILE) -helpdir = $(datadir)/kimchi/ui/pages/help +helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help dist_help_DATA = kimchi.css diff --git a/plugins/kimchi/ui/pages/help/de_DE/Makefile.am b/plugins/kimchi/ui/pages/help/de_DE/Makefile.am index ab1c769..3d99aae 100644 --- a/plugins/kimchi/ui/pages/help/de_DE/Makefile.am +++ b/plugins/kimchi/ui/pages/help/de_DE/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -de_DE_helpdir = $(datadir)/kimchi/ui/pages/help/de_DE +de_DE_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/de_DE dist_de_DE_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/en_US/Makefile.am b/plugins/kimchi/ui/pages/help/en_US/Makefile.am index d5ab24f..d37f03a 100644 --- a/plugins/kimchi/ui/pages/help/en_US/Makefile.am +++ b/plugins/kimchi/ui/pages/help/en_US/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -en_US_helpdir = $(datadir)/kimchi/ui/pages/help/en_US +en_US_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/en_US dist_en_US_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/es_ES/Makefile.am b/plugins/kimchi/ui/pages/help/es_ES/Makefile.am index a3317a6..29c596f 100644 --- a/plugins/kimchi/ui/pages/help/es_ES/Makefile.am +++ b/plugins/kimchi/ui/pages/help/es_ES/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -es_ES_helpdir = $(datadir)/kimchi/ui/pages/help/es_ES +es_ES_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/es_ES dist_es_ES_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/fr_FR/Makefile.am b/plugins/kimchi/ui/pages/help/fr_FR/Makefile.am index a5eba5a..11ce394 100644 --- a/plugins/kimchi/ui/pages/help/fr_FR/Makefile.am +++ b/plugins/kimchi/ui/pages/help/fr_FR/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -fr_FR_helpdir = $(datadir)/kimchi/ui/pages/help/fr_FR +fr_FR_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/fr_FR dist_fr_FR_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/it_IT/Makefile.am b/plugins/kimchi/ui/pages/help/it_IT/Makefile.am index c828f26..62e2f29 100644 --- a/plugins/kimchi/ui/pages/help/it_IT/Makefile.am +++ b/plugins/kimchi/ui/pages/help/it_IT/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -it_IT_helpdir = $(datadir)/kimchi/ui/pages/help/it_IT +it_IT_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/it_IT dist_it_IT_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/ja_JP/Makefile.am b/plugins/kimchi/ui/pages/help/ja_JP/Makefile.am index a7d6464..f9c2f33 100644 --- a/plugins/kimchi/ui/pages/help/ja_JP/Makefile.am +++ b/plugins/kimchi/ui/pages/help/ja_JP/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -ja_JP_helpdir = $(datadir)/kimchi/ui/pages/help/ja_JP +ja_JP_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/ja_JP dist_ja_JP_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/ko_KR/Makefile.am b/plugins/kimchi/ui/pages/help/ko_KR/Makefile.am index 3242ad7..e441955 100644 --- a/plugins/kimchi/ui/pages/help/ko_KR/Makefile.am +++ b/plugins/kimchi/ui/pages/help/ko_KR/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -ko_KR_helpdir = $(datadir)/kimchi/ui/pages/help/ko_KR +ko_KR_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/ko_KR dist_ko_KR_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/pt_BR/Makefile.am b/plugins/kimchi/ui/pages/help/pt_BR/Makefile.am index 0f1df92..7fc2cb0 100644 --- a/plugins/kimchi/ui/pages/help/pt_BR/Makefile.am +++ b/plugins/kimchi/ui/pages/help/pt_BR/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -pt_BR_helpdir = $(datadir)/kimchi/ui/pages/help/pt_BR +pt_BR_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/pt_BR dist_pt_BR_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/ru_RU/Makefile.am b/plugins/kimchi/ui/pages/help/ru_RU/Makefile.am index b128c6d..85ca27a 100644 --- a/plugins/kimchi/ui/pages/help/ru_RU/Makefile.am +++ b/plugins/kimchi/ui/pages/help/ru_RU/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -ru_RU_helpdir = $(datadir)/kimchi/ui/pages/help/ru_RU +ru_RU_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/ru_RU dist_ru_RU_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/zh_CN/Makefile.am b/plugins/kimchi/ui/pages/help/zh_CN/Makefile.am index 8b812ff..e785048 100644 --- a/plugins/kimchi/ui/pages/help/zh_CN/Makefile.am +++ b/plugins/kimchi/ui/pages/help/zh_CN/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -zh_CN_helpdir = $(datadir)/kimchi/ui/pages/help/zh_CN +zh_CN_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/zh_CN dist_zh_CN_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/help/zh_TW/Makefile.am b/plugins/kimchi/ui/pages/help/zh_TW/Makefile.am index 911d737..9c8ac26 100644 --- a/plugins/kimchi/ui/pages/help/zh_TW/Makefile.am +++ b/plugins/kimchi/ui/pages/help/zh_TW/Makefile.am @@ -14,7 +14,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -zh_TW_helpdir = $(datadir)/kimchi/ui/pages/help/zh_TW +zh_TW_helpdir = $(datadir)/wok/plugins/kimchi/ui/pages/help/zh_TW dist_zh_TW_help_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/pages/tabs/Makefile.am b/plugins/kimchi/ui/pages/tabs/Makefile.am index a29df7e..4d5d33e 100644 --- a/plugins/kimchi/ui/pages/tabs/Makefile.am +++ b/plugins/kimchi/ui/pages/tabs/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -tabshtmldir = $(datadir)/kimchi/ui/pages/tabs +tabshtmldir = $(datadir)/wok/plugins/kimchi/ui/pages/tabs dist_tabshtml_DATA = $(wildcard *.html.tmpl) $(NULL) diff --git a/plugins/kimchi/ui/spice-html5/Makefile.am b/plugins/kimchi/ui/spice-html5/Makefile.am index 3a6558a..c43f1ef 100644 --- a/plugins/kimchi/ui/spice-html5/Makefile.am +++ b/plugins/kimchi/ui/spice-html5/Makefile.am @@ -20,6 +20,6 @@ SUBDIRS = pages if WITH_SPICE SUBDIRS += css thirdparty -spicehtml5dir = $(datadir)/kimchi/ui/spice-html5 +spicehtml5dir = $(datadir)/wok/plugins/kimchi/ui/spice-html5 dist_spicehtml5_DATA = $(wildcard *.js) $(NULL) endif diff --git a/plugins/kimchi/ui/spice-html5/css/Makefile.am b/plugins/kimchi/ui/spice-html5/css/Makefile.am index 6106e0d..ed51972 100644 --- a/plugins/kimchi/ui/spice-html5/css/Makefile.am +++ b/plugins/kimchi/ui/spice-html5/css/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -spicecssdir = $(datadir)/kimchi/ui/spice-html5 +spicecssdir = $(datadir)/wok/plugins/kimchi/ui/spice-html5 dist_spicecss_DATA = $(wildcard *.css) $(NULL) diff --git a/plugins/kimchi/ui/spice-html5/pages/Makefile.am b/plugins/kimchi/ui/spice-html5/pages/Makefile.am index 45e67a5..431ec6c 100644 --- a/plugins/kimchi/ui/spice-html5/pages/Makefile.am +++ b/plugins/kimchi/ui/spice-html5/pages/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -spicepagesdir = $(datadir)/kimchi/ui/spice-html5/pages +spicepagesdir = $(datadir)/wok/plugins/kimchi/ui/spice-html5/pages dist_spicepages_DATA = $(wildcard *.html) $(NULL) diff --git a/plugins/kimchi/ui/spice-html5/thirdparty/Makefile.am b/plugins/kimchi/ui/spice-html5/thirdparty/Makefile.am index b83a585..474478d 100644 --- a/plugins/kimchi/ui/spice-html5/thirdparty/Makefile.am +++ b/plugins/kimchi/ui/spice-html5/thirdparty/Makefile.am @@ -15,6 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -thirdpartydir = $(datadir)/kimchi/ui/spice-html5/thirdparty +thirdpartydir = $(datadir)/wok/plugins/kimchi/ui/spice-html5/thirdparty dist_thirdparty_DATA = $(wildcard *.js) $(NULL) diff --git a/plugins/kimchi/xmlutils/Makefile.am b/plugins/kimchi/xmlutils/Makefile.am index 73f86f4..207ad7f 100644 --- a/plugins/kimchi/xmlutils/Makefile.am +++ b/plugins/kimchi/xmlutils/Makefile.am @@ -19,7 +19,7 @@ xmlutils_PYTHON = *.py -xmlutilsdir = $(pythondir)/kimchi/xmlutils +xmlutilsdir = $(pythondir)/wok/plugins/kimchi/xmlutils install-data-local: $(MKDIR_P) $(DESTDIR)$(xmlutilsdir) -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:42 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:42 -0300 Subject: [Kimchi-devel] [PATCH V3 10/34] Update wok daemon and specs In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-11-git-send-email-luciojhc@linux.vnet.ibm.com> - Rename from kimchi(d) to wok(d) - Remove all kimchi specifics (including deps) - Do not check for libvirt status - Reflect new file names/structure - Replace gettext-devel dependency by gettext Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- contrib/DEBIAN/control.in | 15 +----- contrib/DEBIAN/postrm | 4 +- contrib/make-deb.sh.in | 2 +- contrib/wok.spec.fedora.in | 106 ++++++++++++++------------------------ contrib/wok.spec.suse.in | 101 +++++++++++++++--------------------- contrib/wokd-upstart.conf.debian | 14 ++---- contrib/wokd-upstart.conf.fedora | 11 +--- contrib/wokd.service.fedora | 6 +- contrib/wokd.sysvinit | 18 +++--- src/firewalld.xml | 4 +- 10 files changed, 105 insertions(+), 176 deletions(-) diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in index a288e9b..ef4e0c2 100644 --- a/contrib/DEBIAN/control.in +++ b/contrib/DEBIAN/control.in @@ -6,31 +6,18 @@ Architecture: all Depends: python-cherrypy3 (>= 3.2.0), python-cheetah, python-imaging, - python-configobj, websockify, novnc, python-jsonschema (>= 1.3.0), - python-libvirt, gettext, - libvirt-bin, - nfs-common, python-m2crypto, - qemu-kvm, python-pam, - python-parted, - python-psutil (>= 0.6.0), - python-ethtool, - sosreport, - python-ipaddr, python-lxml, - open-iscsi, nginx, - python-guestfs, python-ldap, - libguestfs-tools, spice-html5 Build-Depends: libxslt, openssl, python-lxml Maintainer: Aline Manera -Description: Kimchi web server +Description: Wok - Webserver Originated from Kimchi diff --git a/contrib/DEBIAN/postrm b/contrib/DEBIAN/postrm index ef90b49..256a234 100755 --- a/contrib/DEBIAN/postrm +++ b/contrib/DEBIAN/postrm @@ -20,9 +20,9 @@ case "$1" in remove) - rm -rf /var/log/kimchi /var/run/kimchi.pid + rm -rf /var/log/wok /var/run/wok.pid ;; purge) - rm -rf /var/log/kimchi /var/run/kimchi.pid /usr/share/kimchi/ + rm -rf /var/log/wok /var/run/wok.pid /usr/share/wok/ ;; esac diff --git a/contrib/make-deb.sh.in b/contrib/make-deb.sh.in index 5a6e56a..6c42072 100644 --- a/contrib/make-deb.sh.in +++ b/contrib/make-deb.sh.in @@ -11,5 +11,5 @@ fi TMPDIR=`mktemp -d` make DESTDIR=$TMPDIR install-deb -dpkg-deb -b $TMPDIR kimchi-${VERSION}-${RELEASE}.noarch.deb +dpkg-deb -b $TMPDIR wok-${VERSION}-${RELEASE}.noarch.deb rm -rf $TMPDIR diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in index 183fd43..edbe385 100644 --- a/contrib/wok.spec.fedora.in +++ b/contrib/wok.spec.fedora.in @@ -1,38 +1,24 @@ -Name: kimchi +Name: wok Version: @PACKAGE_VERSION@ Release: @PACKAGE_RELEASE@%{?dist} -Summary: Kimchi server application +Summary: Wok - Webserver Originated from Kimchi BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release} BuildArch: noarch Group: System Environment/Base License: LGPL/ASL2 Source0: %{name}-%{version}.tar.gz -Requires: qemu-kvm -Requires: gettext-devel -Requires: libvirt -Requires: libvirt-python -Requires: libvirt-daemon-config-network +Requires: gettext Requires: python-cherrypy >= 3.2.0 Requires: python-cheetah Requires: python-websockify -Requires: python-configobj Requires: novnc Requires: m2crypto Requires: python-imaging Requires: PyPAM -Requires: pyparted -Requires: python-psutil >= 0.6.0 Requires: python-jsonschema >= 1.3.0 -Requires: python-ethtool -Requires: sos -Requires: python-ipaddr Requires: python-lxml -Requires: nfs-utils Requires: nginx -Requires: iscsi-initiator-utils Requires: python-ldap -Requires: python-libguestfs -Requires: libguestfs-tools BuildRequires: libxslt BuildRequires: openssl BuildRequires: python-lxml @@ -64,7 +50,7 @@ BuildRequires: systemd-units %endif %description -Web server application to manage KVM/Qemu virtual machines +Wok is Webserver Originated from Kimchi. %prep @@ -84,22 +70,18 @@ make rm -rf %{buildroot} make DESTDIR=%{buildroot} install -%if 0%{?with_systemd} - -%endif - %if 0%{?rhel} == 6 # Install the upstart script -install -Dm 0755 contrib/kimchid-upstart.conf.fedora %{buildroot}/etc/init/kimchid.conf +install -Dm 0755 contrib/wokd-upstart.conf.fedora %{buildroot}/etc/init/wokd.conf %endif %if 0%{?rhel} == 5 # Install the SysV init scripts -install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid +install -Dm 0755 contrib/wokd.sysvinit %{buildroot}%{_initrddir}/wokd %endif %post if [ $1 -eq 1 ] ; then - /bin/systemctl enable kimchid.service >/dev/null 2>&1 || : + /bin/systemctl enable wokd.service >/dev/null 2>&1 || : # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi @@ -109,8 +91,8 @@ fi if [ $1 -eq 0 ] ; then # Package removal, not upgrade - /bin/systemctl --no-reload disable kimchid.service > /dev/null 2>&1 || : - /bin/systemctl stop kimchid.service > /dev/null 2>&1 || : + /bin/systemctl --no-reload disable wokd.service > /dev/null 2>&1 || : + /bin/systemctl stop wokd.service > /dev/null 2>&1 || : fi exit 0 @@ -118,7 +100,7 @@ exit 0 %postun if [ "$1" -ge 1 ] ; then - /bin/systemctl try-restart kimchid.service >/dev/null 2>&1 || : + /bin/systemctl try-restart wokd.service >/dev/null 2>&1 || : fi exit 0 @@ -127,55 +109,43 @@ rm -rf $RPM_BUILD_ROOT %files %attr(-,root,root) -%{_bindir}/kimchid -%{python_sitelib}/kimchi/*.py* -%{python_sitelib}/kimchi/control/*.py* -%{python_sitelib}/kimchi/control/vm/*.py* -%{python_sitelib}/kimchi/model/*.py* -%{python_sitelib}/kimchi/xmlutils/*.py* -%{python_sitelib}/kimchi/API.json -%{python_sitelib}/kimchi/plugins/*.py* -%{python_sitelib}/kimchi/ -%{_datadir}/kimchi/doc/API.md -%{_datadir}/kimchi/doc/README.md -%{_datadir}/kimchi/doc/README-federation.md -%{_datadir}/kimchi/doc/kimchi-guest.png -%{_datadir}/kimchi/doc/kimchi-templates.png -%{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo -%{_datadir}/kimchi/config/ui/*.xml -%{_datadir}/kimchi/ui/ -%{_datadir}/kimchi -%{_sysconfdir}/nginx/conf.d/kimchi.conf.in -%{_sysconfdir}/nginx/conf.d/kimchi.conf -%{_sysconfdir}/kimchi/kimchi.conf -%{_sysconfdir}/kimchi/template.conf -%{_sysconfdir}/kimchi/distros.d/debian.json -%{_sysconfdir}/kimchi/distros.d/fedora.json -%{_sysconfdir}/kimchi/distros.d/opensuse.json -%{_sysconfdir}/kimchi/distros.d/ubuntu.json -%{_sysconfdir}/kimchi/distros.d/gentoo.json -%{_sysconfdir}/kimchi/ -%{_sharedstatedir}/kimchi/debugreports/ -%{_sharedstatedir}/kimchi/screenshots/ -%{_sharedstatedir}/kimchi/vnc-tokens/ -%{_sharedstatedir}/kimchi/isos/ -%{_sharedstatedir}/kimchi/ -%{_localstatedir}/log/kimchi/* -%{_localstatedir}/log/kimchi/ -%{_mandir}/man8/kimchid.8.gz +%{_bindir}/wokd +%{python_sitelib}/wok/*.py* +%{python_sitelib}/wok/control/*.py* +%{python_sitelib}/wok/model/*.py* +%{python_sitelib}/wok/xmlutils/*.py* +%{python_sitelib}/wok/API.json +%{python_sitelib}/wok/plugins/*.py* +%{python_sitelib}/wok/ +%{_prefix}/share/locale/*/LC_MESSAGES/wok.mo +%{_datadir}/wok/ui/ +%{_datadir}/wok +%{_sysconfdir}/nginx/conf.d/wok.conf.in +%{_sysconfdir}/nginx/conf.d/wok.conf +%{_sysconfdir}/wok/wok.conf +%{_sysconfdir}/wok/ +%{_sharedstatedir}/wok/vnc-tokens/ +%{_sharedstatedir}/wok/ +%{_localstatedir}/log/wok/* +%{_localstatedir}/log/wok/ +%{_mandir}/man8/wokd.8.gz %if 0%{?with_systemd} -%{_unitdir}/kimchid.service -%{_prefix}/lib/firewalld/services/kimchid.xml +%{_unitdir}/wokd.service +%{_prefix}/lib/firewalld/services/wokd.xml %endif %if 0%{?rhel} == 6 -/etc/init/kimchid.conf +/etc/init/wokd.conf %endif %if 0%{?rhel} == 5 -%{_initrddir}/kimchid +%{_initrddir}/wokd %endif %changelog +* Fri Jun 19 2015 Lucio Correia 1.6 +- Rename to wokd +- Remove kimchi specifics + * Thu Feb 26 2015 Fr??d??ric Bonnard 1.4.0 - Add man page for kimchid diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in index 54228ae..63bdce3 100644 --- a/contrib/wok.spec.suse.in +++ b/contrib/wok.spec.suse.in @@ -1,38 +1,25 @@ -Name: kimchi +Name: wok Version: @PACKAGE_VERSION@ Release: @PACKAGE_RELEASE@%{?dist} -Summary: Kimchi server application +Summary: Wok - Webserver Originated from Kimchi BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release} BuildArch: noarch Group: System Environment/Base License: LGPL/ASL2 Source0: %{name}-%{version}.tar.gz -Requires: kvm Requires: gettext-tools -Requires: libvirt -Requires: libvirt-python -Requires: libvirt-daemon-config-network Requires: python-CherryPy >= 3.2.0 Requires: python-Cheetah Requires: python-websockify -Requires: python-configobj Requires: novnc Requires: python-imaging Requires: python-M2Crypto Requires: python-pam -Requires: python-parted -Requires: python-psutil >= 0.6.0 Requires: python-jsonschema >= 1.3.0 -Requires: python-ethtool -Requires: python-ipaddr Requires: python-ldap Requires: python-lxml Requires: python-xml -Requires: nfs-client Requires: nginx -Requires: open-iscsi -Requires: python-libguestfs -Requires: guestfs-tools BuildRequires: libxslt-tools BuildRequires: openssl BuildRequires: python-lxml @@ -46,7 +33,7 @@ Requires: python-ordereddict %endif %description -Web server application to manage KVM/Qemu virtual machines +Wok is Webserver Originated from Kimchi. %prep %setup @@ -59,29 +46,30 @@ make rm -rf %{buildroot} make DESTDIR=%{buildroot} install + %post %if 0%{?with_systemd} - /bin/systemctl enable kimchid.service >/dev/null 2>&1 || : + /bin/systemctl enable wokd.service >/dev/null 2>&1 || : /bin/systemctl daemon-reload >/dev/null 2>&1 || : %else - chkconfig kimchid on + chkconfig wokd on %endif exit 0 %preun %if 0%{?with_systemd} - /bin/systemctl --no-reload disable kimchid.service > /dev/null 2>&1 || : - /bin/systemctl stop kimchid.service > /dev/null 2>&1 || : + /bin/systemctl --no-reload disable wokd.service > /dev/null 2>&1 || : + /bin/systemctl stop wokd.service > /dev/null 2>&1 || : %else - service kimchid stop + service wokd stop %endif exit 0 %postun %if 0%{?with_systemd} - /bin/systemctl try-restart kimchid.service >/dev/null 2>&1 || : + /bin/systemctl try-restart wokd.service >/dev/null 2>&1 || : %endif exit 0 @@ -90,43 +78,34 @@ rm -rf $RPM_BUILD_ROOT %files %attr(-,root,root) -%{_bindir}/kimchid -%{python_sitelib}/kimchi/*.py* -%{python_sitelib}/kimchi/control/*.py* -%{python_sitelib}/kimchi/control/vm/*.py* -%{python_sitelib}/kimchi/model/*.py* -%{python_sitelib}/kimchi/xmlutils/*.py* -%{python_sitelib}/kimchi/API.json -%{python_sitelib}/kimchi/plugins/*.py* -%{python_sitelib}/kimchi/ -%{_datadir}/kimchi/doc/API.md -%{_datadir}/kimchi/doc/README.md -%{_datadir}/kimchi/doc/README-federation.md -%{_datadir}/kimchi/doc/kimchi-guest.png -%{_datadir}/kimchi/doc/kimchi-templates.png -%{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo -%{_datadir}/kimchi/config/ui/*.xml -%{_datadir}/kimchi/ui/ -%{_datadir}/kimchi -%{_sysconfdir}/nginx/conf.d/kimchi.conf.in -%{_sysconfdir}/nginx/conf.d/kimchi.conf -%{_sysconfdir}/kimchi/kimchi.conf -%{_sysconfdir}/kimchi/template.conf -%{_sysconfdir}/kimchi/distros.d/debian.json -%{_sysconfdir}/kimchi/distros.d/fedora.json -%{_sysconfdir}/kimchi/distros.d/opensuse.json -%{_sysconfdir}/kimchi/distros.d/ubuntu.json -%{_sysconfdir}/kimchi/distros.d/gentoo.json -%{_sysconfdir}/kimchi -%{_sysconfdir}/kimchi/ -%{_var}/lib/kimchi/debugreports/ -%{_var}/lib/kimchi/screenshots/ -%{_var}/lib/kimchi/vnc-tokens/ -%{_var}/lib/kimchi/isos/ -%{_var}/lib/kimchi/ -%{_localstatedir}/log/kimchi/* -%{_localstatedir}/log/kimchi/ -%{_mandir}/man8/kimchid.8.gz +%{_bindir}/wokd +%{python_sitelib}/wok/*.py* +%{python_sitelib}/wok/control/*.py* +%{python_sitelib}/wok/model/*.py* +%{python_sitelib}/wok/xmlutils/*.py* +%{python_sitelib}/wok/API.json +%{python_sitelib}/wok/plugins/*.py* +%{python_sitelib}/wok/ +%{_prefix}/share/locale/*/LC_MESSAGES/wok.mo +%{_datadir}/wok/ui/ +%{_datadir}/wok +%{_sysconfdir}/wok/wok.conf +%{_sysconfdir}/wok/ +%{_sysconfdir}/nginx/conf.d/wok.conf.in +%{_sysconfdir}/nginx/conf.d/wok.conf +%{_var}/lib/wok/vnc-tokens/ +%{_var}/lib/wok/ +%{_localstatedir}/log/wok/* +%{_localstatedir}/log/wok/ +%{_mandir}/man8/wokd.8.gz + +%if 0%{?with_systemd} +%{_unitdir}/wokd.service +%else +%{_initrddir}/wokd +%endif + + %if 0%{?with_systemd} %{_unitdir}/kimchid.service @@ -136,6 +115,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jun 19 2015 Lucio Correia 1.6 +- Rename to wokd +- Remove kimchi specifics + * Thu Feb 26 2015 Fr??d??ric Bonnard 1.4.0 - Add man page for kimchid diff --git a/contrib/wokd-upstart.conf.debian b/contrib/wokd-upstart.conf.debian index a58d3c3..82e9156 100644 --- a/contrib/wokd-upstart.conf.debian +++ b/contrib/wokd-upstart.conf.debian @@ -1,5 +1,5 @@ # -# kimchid - Kimchi Web Server +# wokd - Wok Web Server # # Copyright IBM, Corp. 2013 # @@ -18,17 +18,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -description "Kimchi Web Server" +description "Wok - Webserver Originated from Kimchi" -start on started libvirt-bin -stop on stopped libvirt-bin +start on stopped rc RUNLEVEL=[2345] respawn respawn limit 5 30 -pre-start script - status libvirt-bin | grep -q "start/running" && exit 0 - start libvirt-bin || exit 1 -end script - -exec /usr/bin/kimchid +exec /usr/bin/wokd diff --git a/contrib/wokd-upstart.conf.fedora b/contrib/wokd-upstart.conf.fedora index 53e8a39..f02ce34 100644 --- a/contrib/wokd-upstart.conf.fedora +++ b/contrib/wokd-upstart.conf.fedora @@ -1,5 +1,5 @@ # -# kimchid - Kimchi Web Server +# wokd - Wok Web Server # # Copyright IBM, Corp. 2013 # @@ -18,16 +18,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -description "Kimchi Web Server" +description "Wok - Webserver Originated from Kimchi" start on stopped rc RUNLEVEL=[2345] respawn respawn limit 5 30 -pre-start script - service libvirtd status | grep -q "start/running" && exit 0 - service libvirtd start || exit 1 -end script - -exec /usr/bin/kimchid +exec /usr/bin/wokd diff --git a/contrib/wokd.service.fedora b/contrib/wokd.service.fedora index 7abe49b..17414d3 100644 --- a/contrib/wokd.service.fedora +++ b/contrib/wokd.service.fedora @@ -1,13 +1,13 @@ [Unit] -Description=Kimchi server +Description=Wok - Webserver Originated from Kimchi Requires=libvirtd.service After=libvirtd.service [Service] Type=simple -ExecStart=/usr/bin/kimchid +ExecStart=/usr/bin/wokd ExecStop=/bin/kill -TERM $MAINPID -EnvironmentFile=/etc/kimchi/kimchi.conf +EnvironmentFile=/etc/wok/wok.conf [Install] WantedBy=multi-user.target diff --git a/contrib/wokd.sysvinit b/contrib/wokd.sysvinit index 023b34c..10680ee 100644 --- a/contrib/wokd.sysvinit +++ b/contrib/wokd.sysvinit @@ -1,6 +1,6 @@ #! /bin/sh # -# kimchid Kimchi Web Server +# wokd Wok Web Server # # Copyright IBM, Corp. 2013 # @@ -21,12 +21,12 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ### BEGIN INIT INFO -# Provides: kimchid +# Provides: wokd # Required-Start: libvirtd # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 -# Description: Start the kimchid daemon +# Description: Start the wokd daemon ### END INIT INFO . /etc/rc.status @@ -45,21 +45,21 @@ rc_reset case "$1" in start) - echo -n "Starting kimchid daemon" + echo -n "Starting wokd daemon" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. - startproc -f /usr/bin/kimchid > /dev/null 2>&1 + startproc -f /usr/bin/wokd > /dev/null 2>&1 # Remember status and be verbose rc_status -v ;; stop) - echo -n "Shutting down kimchid daemon" + echo -n "Shutting down wokd daemon" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. - killproc -TERM /usr/bin/kimchid + killproc -TERM /usr/bin/wokd # Remember status and be verbose rc_status -v @@ -82,7 +82,7 @@ case "$1" in rc_status ;; status) - echo -n "Checking for service kimchid " + echo -n "Checking for service wokd " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. @@ -92,7 +92,7 @@ case "$1" in # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running - checkproc /usr/bin/kimchid + checkproc /usr/bin/wokd rc_status -v ;; diff --git a/src/firewalld.xml b/src/firewalld.xml index 03e1510..ff9fafe 100644 --- a/src/firewalld.xml +++ b/src/firewalld.xml @@ -1,7 +1,7 @@ - kimchid - Kimchid is a daemon service for kimchi which is a HTML5 based management tool for KVM. It is designed to make it as easy as possible to get started with KVM and create your first guest. + wokd + wokd is a daemon service for wok which is a web framework. -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:43 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:43 -0300 Subject: [Kimchi-devel] [PATCH V3 11/34] Update kimchi plugin rpm specs In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-12-git-send-email-luciojhc@linux.vnet.ibm.com> - Add dependency on wok - Drop wok specifics from specs - Reflect new plugin structure in the specs - Replace gettext-devel dependency by gettext Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/contrib/DEBIAN/control.in | 6 +- plugins/kimchi/contrib/kimchi.spec.fedora.in | 99 +++++--------------------- plugins/kimchi/contrib/kimchi.spec.suse.in | 71 +++++-------------- 3 files changed, 37 insertions(+), 139 deletions(-) diff --git a/plugins/kimchi/contrib/DEBIAN/control.in b/plugins/kimchi/contrib/DEBIAN/control.in index a288e9b..ecfcd89 100644 --- a/plugins/kimchi/contrib/DEBIAN/control.in +++ b/plugins/kimchi/contrib/DEBIAN/control.in @@ -3,7 +3,8 @@ Version: @PACKAGE_VERSION@ Section: base Priority: optional Architecture: all -Depends: python-cherrypy3 (>= 3.2.0), +Depends: wok, + python-cherrypy3 (>= 3.2.0), python-cheetah, python-imaging, python-configobj, @@ -30,7 +31,6 @@ Depends: python-cherrypy3 (>= 3.2.0), libguestfs-tools, spice-html5 Build-Depends: libxslt, - openssl, python-lxml Maintainer: Aline Manera -Description: Kimchi web server +Description: Kimchi web application diff --git a/plugins/kimchi/contrib/kimchi.spec.fedora.in b/plugins/kimchi/contrib/kimchi.spec.fedora.in index 183fd43..7a7a447 100644 --- a/plugins/kimchi/contrib/kimchi.spec.fedora.in +++ b/plugins/kimchi/contrib/kimchi.spec.fedora.in @@ -7,8 +7,9 @@ BuildArch: noarch Group: System Environment/Base License: LGPL/ASL2 Source0: %{name}-%{version}.tar.gz +Requires: wok Requires: qemu-kvm -Requires: gettext-devel +Requires: gettext Requires: libvirt Requires: libvirt-python Requires: libvirt-daemon-config-network @@ -34,7 +35,6 @@ Requires: python-ldap Requires: python-libguestfs Requires: libguestfs-tools BuildRequires: libxslt -BuildRequires: openssl BuildRequires: python-lxml %if 0%{?rhel} >= 6 || 0%{?fedora} >= 19 @@ -51,20 +51,8 @@ Requires: python-imaging BuildRequires: python-unittest2 %endif -%if 0%{?with_systemd} -Requires: systemd -Requires: firewalld -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -%endif - -%if 0%{?with_systemd} -BuildRequires: systemd-units -%endif - %description -Web server application to manage KVM/Qemu virtual machines +Web application to manage KVM/Qemu virtual machines %prep @@ -84,71 +72,29 @@ make rm -rf %{buildroot} make DESTDIR=%{buildroot} install -%if 0%{?with_systemd} - -%endif - -%if 0%{?rhel} == 6 -# Install the upstart script -install -Dm 0755 contrib/kimchid-upstart.conf.fedora %{buildroot}/etc/init/kimchid.conf -%endif -%if 0%{?rhel} == 5 -# Install the SysV init scripts -install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid -%endif - -%post -if [ $1 -eq 1 ] ; then - /bin/systemctl enable kimchid.service >/dev/null 2>&1 || : - # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi - - -%preun - -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable kimchid.service > /dev/null 2>&1 || : - /bin/systemctl stop kimchid.service > /dev/null 2>&1 || : -fi - -exit 0 - - -%postun -if [ "$1" -ge 1 ] ; then - /bin/systemctl try-restart kimchid.service >/dev/null 2>&1 || : -fi -exit 0 %clean rm -rf $RPM_BUILD_ROOT %files %attr(-,root,root) -%{_bindir}/kimchid -%{python_sitelib}/kimchi/*.py* -%{python_sitelib}/kimchi/control/*.py* -%{python_sitelib}/kimchi/control/vm/*.py* -%{python_sitelib}/kimchi/model/*.py* -%{python_sitelib}/kimchi/xmlutils/*.py* -%{python_sitelib}/kimchi/API.json -%{python_sitelib}/kimchi/plugins/*.py* -%{python_sitelib}/kimchi/ +%{python_sitelib}/wok/plugins/kimchi/*.py* +%{python_sitelib}/wok/plugins/kimchi/control/*.py* +%{python_sitelib}/wok/plugins/kimchi/control/vm/*.py* +%{python_sitelib}/wok/plugins/kimchi/model/*.py* +%{python_sitelib}/wok/plugins/kimchi/API.json +%{python_sitelib}/wok/plugins/kimchi/ %{_datadir}/kimchi/doc/API.md %{_datadir}/kimchi/doc/README.md %{_datadir}/kimchi/doc/README-federation.md %{_datadir}/kimchi/doc/kimchi-guest.png %{_datadir}/kimchi/doc/kimchi-templates.png %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo -%{_datadir}/kimchi/config/ui/*.xml -%{_datadir}/kimchi/ui/ -%{_datadir}/kimchi -%{_sysconfdir}/nginx/conf.d/kimchi.conf.in -%{_sysconfdir}/nginx/conf.d/kimchi.conf -%{_sysconfdir}/kimchi/kimchi.conf -%{_sysconfdir}/kimchi/template.conf +%{_datadir}/wok/plugins/kimchi/ui/config/*.xml +%{_datadir}/wok/plugins/kimchi/ui/ +%{_datadir}/wok/plugins/kimchi +%{_sysconfdir}/wok/plugins.d/kimchi.conf +%{_sysconfdir}/wok/plugins.d/template.conf %{_sysconfdir}/kimchi/distros.d/debian.json %{_sysconfdir}/kimchi/distros.d/fedora.json %{_sysconfdir}/kimchi/distros.d/opensuse.json @@ -157,25 +103,14 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/kimchi/ %{_sharedstatedir}/kimchi/debugreports/ %{_sharedstatedir}/kimchi/screenshots/ -%{_sharedstatedir}/kimchi/vnc-tokens/ %{_sharedstatedir}/kimchi/isos/ %{_sharedstatedir}/kimchi/ -%{_localstatedir}/log/kimchi/* -%{_localstatedir}/log/kimchi/ -%{_mandir}/man8/kimchid.8.gz -%if 0%{?with_systemd} -%{_unitdir}/kimchid.service -%{_prefix}/lib/firewalld/services/kimchid.xml -%endif -%if 0%{?rhel} == 6 -/etc/init/kimchid.conf -%endif -%if 0%{?rhel} == 5 -%{_initrddir}/kimchid -%endif %changelog +* Thu Jun 18 2015 Lucio Correia 1.6 +- Run kimchi as a plugin + * Thu Feb 26 2015 Fr??d??ric Bonnard 1.4.0 - Add man page for kimchid diff --git a/plugins/kimchi/contrib/kimchi.spec.suse.in b/plugins/kimchi/contrib/kimchi.spec.suse.in index 54228ae..1ab2e5f 100644 --- a/plugins/kimchi/contrib/kimchi.spec.suse.in +++ b/plugins/kimchi/contrib/kimchi.spec.suse.in @@ -7,6 +7,7 @@ BuildArch: noarch Group: System Environment/Base License: LGPL/ASL2 Source0: %{name}-%{version}.tar.gz +Requires: wok Requires: kvm Requires: gettext-tools Requires: libvirt @@ -34,7 +35,6 @@ Requires: open-iscsi Requires: python-libguestfs Requires: guestfs-tools BuildRequires: libxslt-tools -BuildRequires: openssl BuildRequires: python-lxml %if 0%{?suse_version} == 1100 @@ -46,7 +46,7 @@ Requires: python-ordereddict %endif %description -Web server application to manage KVM/Qemu virtual machines +Web application to manage KVM/Qemu virtual machines %prep %setup @@ -59,83 +59,46 @@ make rm -rf %{buildroot} make DESTDIR=%{buildroot} install -%post -%if 0%{?with_systemd} - /bin/systemctl enable kimchid.service >/dev/null 2>&1 || : - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -%else - chkconfig kimchid on -%endif -exit 0 - - -%preun -%if 0%{?with_systemd} - /bin/systemctl --no-reload disable kimchid.service > /dev/null 2>&1 || : - /bin/systemctl stop kimchid.service > /dev/null 2>&1 || : -%else - service kimchid stop -%endif -exit 0 - - -%postun -%if 0%{?with_systemd} - /bin/systemctl try-restart kimchid.service >/dev/null 2>&1 || : -%endif -exit 0 %clean rm -rf $RPM_BUILD_ROOT %files %attr(-,root,root) -%{_bindir}/kimchid -%{python_sitelib}/kimchi/*.py* -%{python_sitelib}/kimchi/control/*.py* -%{python_sitelib}/kimchi/control/vm/*.py* -%{python_sitelib}/kimchi/model/*.py* -%{python_sitelib}/kimchi/xmlutils/*.py* -%{python_sitelib}/kimchi/API.json -%{python_sitelib}/kimchi/plugins/*.py* -%{python_sitelib}/kimchi/ +%{python_sitelib}/wok/plugins/kimchi/*.py* +%{python_sitelib}/wok/plugins/kimchi/control/*.py* +%{python_sitelib}/wok/plugins/kimchi/control/vm/*.py* +%{python_sitelib}/wok/plugins/kimchi/model/*.py* +%{python_sitelib}/wok/plugins/kimchi/API.json +%{python_sitelib}/wok/plugins/kimchi/ %{_datadir}/kimchi/doc/API.md %{_datadir}/kimchi/doc/README.md %{_datadir}/kimchi/doc/README-federation.md %{_datadir}/kimchi/doc/kimchi-guest.png %{_datadir}/kimchi/doc/kimchi-templates.png %{_prefix}/share/locale/*/LC_MESSAGES/kimchi.mo -%{_datadir}/kimchi/config/ui/*.xml -%{_datadir}/kimchi/ui/ -%{_datadir}/kimchi -%{_sysconfdir}/nginx/conf.d/kimchi.conf.in -%{_sysconfdir}/nginx/conf.d/kimchi.conf -%{_sysconfdir}/kimchi/kimchi.conf -%{_sysconfdir}/kimchi/template.conf +%{_datadir}/wok/plugins/kimchi/ui/config/*.xml +%{_datadir}/wok/plugins/kimchi/ui/ +%{_datadir}/wok/plugins/kimchi +%{_sysconfdir}/wok/plugins.d/kimchi.conf +%{_sysconfdir}/wok/plugins.d/template.conf %{_sysconfdir}/kimchi/distros.d/debian.json %{_sysconfdir}/kimchi/distros.d/fedora.json %{_sysconfdir}/kimchi/distros.d/opensuse.json %{_sysconfdir}/kimchi/distros.d/ubuntu.json %{_sysconfdir}/kimchi/distros.d/gentoo.json -%{_sysconfdir}/kimchi %{_sysconfdir}/kimchi/ %{_var}/lib/kimchi/debugreports/ %{_var}/lib/kimchi/screenshots/ -%{_var}/lib/kimchi/vnc-tokens/ %{_var}/lib/kimchi/isos/ %{_var}/lib/kimchi/ -%{_localstatedir}/log/kimchi/* -%{_localstatedir}/log/kimchi/ -%{_mandir}/man8/kimchid.8.gz - -%if 0%{?with_systemd} -%{_unitdir}/kimchid.service -%else -%{_initrddir}/kimchid -%endif + %changelog +* Thu Jun 18 2015 Lucio Correia 1.6 +- Run kimchi as a plugin + * Thu Feb 26 2015 Fr??d??ric Bonnard 1.4.0 - Add man page for kimchid -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:35 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:35 -0300 Subject: [Kimchi-devel] [PATCH V3 03/34] Rename src/kimchi to src/wok In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-4-git-send-email-luciojhc@linux.vnet.ibm.com> This patch only renames the directory src/kimchi to src/wok. These files will compose Wok, the web server. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- src/{kimchi => wok}/Makefile.am | 0 src/{kimchi => wok}/__init__.py | 0 src/{kimchi => wok}/asynctask.py | 0 src/{kimchi => wok}/auth.py | 0 src/{kimchi => wok}/basemodel.py | 0 src/{kimchi => wok}/cachebust.py | 0 src/{kimchi => wok}/config.py.in | 0 src/{kimchi => wok}/control/base.py | 0 src/{kimchi => wok}/control/plugins.py | 0 src/{kimchi => wok}/control/utils.py | 0 src/{kimchi => wok}/exception.py | 0 src/{kimchi => wok}/model/plugins.py | 0 src/{kimchi => wok}/netinfo.py | 0 src/{kimchi => wok}/network.py | 0 src/{kimchi => wok}/objectstore.py | 0 src/{kimchi => wok}/proxy.py | 0 src/{kimchi => wok}/rollbackcontext.py | 0 src/{kimchi => wok}/root.py | 0 src/{kimchi => wok}/server.py | 0 src/{kimchi => wok}/sslcert.py | 0 src/{kimchi => wok}/template.py | 0 src/{kimchi => wok}/utils.py | 0 src/{kimchi => wok}/vnc.py | 0 src/{kimchi => wok}/xmlutils/utils.py | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename src/{kimchi => wok}/Makefile.am (100%) rename src/{kimchi => wok}/__init__.py (100%) rename src/{kimchi => wok}/asynctask.py (100%) rename src/{kimchi => wok}/auth.py (100%) rename src/{kimchi => wok}/basemodel.py (100%) rename src/{kimchi => wok}/cachebust.py (100%) rename src/{kimchi => wok}/config.py.in (100%) rename src/{kimchi => wok}/control/base.py (100%) rename src/{kimchi => wok}/control/plugins.py (100%) rename src/{kimchi => wok}/control/utils.py (100%) rename src/{kimchi => wok}/exception.py (100%) rename src/{kimchi => wok}/model/plugins.py (100%) rename src/{kimchi => wok}/netinfo.py (100%) rename src/{kimchi => wok}/network.py (100%) rename src/{kimchi => wok}/objectstore.py (100%) rename src/{kimchi => wok}/proxy.py (100%) rename src/{kimchi => wok}/rollbackcontext.py (100%) rename src/{kimchi => wok}/root.py (100%) rename src/{kimchi => wok}/server.py (100%) rename src/{kimchi => wok}/sslcert.py (100%) rename src/{kimchi => wok}/template.py (100%) rename src/{kimchi => wok}/utils.py (100%) rename src/{kimchi => wok}/vnc.py (100%) rename src/{kimchi => wok}/xmlutils/utils.py (100%) diff --git a/src/kimchi/Makefile.am b/src/wok/Makefile.am similarity index 100% rename from src/kimchi/Makefile.am rename to src/wok/Makefile.am diff --git a/src/kimchi/__init__.py b/src/wok/__init__.py similarity index 100% rename from src/kimchi/__init__.py rename to src/wok/__init__.py diff --git a/src/kimchi/asynctask.py b/src/wok/asynctask.py similarity index 100% rename from src/kimchi/asynctask.py rename to src/wok/asynctask.py diff --git a/src/kimchi/auth.py b/src/wok/auth.py similarity index 100% rename from src/kimchi/auth.py rename to src/wok/auth.py diff --git a/src/kimchi/basemodel.py b/src/wok/basemodel.py similarity index 100% rename from src/kimchi/basemodel.py rename to src/wok/basemodel.py diff --git a/src/kimchi/cachebust.py b/src/wok/cachebust.py similarity index 100% rename from src/kimchi/cachebust.py rename to src/wok/cachebust.py diff --git a/src/kimchi/config.py.in b/src/wok/config.py.in similarity index 100% rename from src/kimchi/config.py.in rename to src/wok/config.py.in diff --git a/src/kimchi/control/base.py b/src/wok/control/base.py similarity index 100% rename from src/kimchi/control/base.py rename to src/wok/control/base.py diff --git a/src/kimchi/control/plugins.py b/src/wok/control/plugins.py similarity index 100% rename from src/kimchi/control/plugins.py rename to src/wok/control/plugins.py diff --git a/src/kimchi/control/utils.py b/src/wok/control/utils.py similarity index 100% rename from src/kimchi/control/utils.py rename to src/wok/control/utils.py diff --git a/src/kimchi/exception.py b/src/wok/exception.py similarity index 100% rename from src/kimchi/exception.py rename to src/wok/exception.py diff --git a/src/kimchi/model/plugins.py b/src/wok/model/plugins.py similarity index 100% rename from src/kimchi/model/plugins.py rename to src/wok/model/plugins.py diff --git a/src/kimchi/netinfo.py b/src/wok/netinfo.py similarity index 100% rename from src/kimchi/netinfo.py rename to src/wok/netinfo.py diff --git a/src/kimchi/network.py b/src/wok/network.py similarity index 100% rename from src/kimchi/network.py rename to src/wok/network.py diff --git a/src/kimchi/objectstore.py b/src/wok/objectstore.py similarity index 100% rename from src/kimchi/objectstore.py rename to src/wok/objectstore.py diff --git a/src/kimchi/proxy.py b/src/wok/proxy.py similarity index 100% rename from src/kimchi/proxy.py rename to src/wok/proxy.py diff --git a/src/kimchi/rollbackcontext.py b/src/wok/rollbackcontext.py similarity index 100% rename from src/kimchi/rollbackcontext.py rename to src/wok/rollbackcontext.py diff --git a/src/kimchi/root.py b/src/wok/root.py similarity index 100% rename from src/kimchi/root.py rename to src/wok/root.py diff --git a/src/kimchi/server.py b/src/wok/server.py similarity index 100% rename from src/kimchi/server.py rename to src/wok/server.py diff --git a/src/kimchi/sslcert.py b/src/wok/sslcert.py similarity index 100% rename from src/kimchi/sslcert.py rename to src/wok/sslcert.py diff --git a/src/kimchi/template.py b/src/wok/template.py similarity index 100% rename from src/kimchi/template.py rename to src/wok/template.py diff --git a/src/kimchi/utils.py b/src/wok/utils.py similarity index 100% rename from src/kimchi/utils.py rename to src/wok/utils.py diff --git a/src/kimchi/vnc.py b/src/wok/vnc.py similarity index 100% rename from src/kimchi/vnc.py rename to src/wok/vnc.py diff --git a/src/kimchi/xmlutils/utils.py b/src/wok/xmlutils/utils.py similarity index 100% rename from src/kimchi/xmlutils/utils.py rename to src/wok/xmlutils/utils.py -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:33 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:33 -0300 Subject: [Kimchi-devel] [PATCH V3 01/34] Add makefiles for fontello In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-2-git-send-email-luciojhc@linux.vnet.ibm.com> Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- configure.ac | 3 +++ src/kimchi/config.py.in | 2 +- ui/Makefile.am | 2 +- ui/{ => fontello}/Makefile.am | 8 ++++---- ui/{ => fontello/css}/Makefile.am | 8 +++----- ui/{ => fontello/font}/Makefile.am | 8 +++----- 6 files changed, 15 insertions(+), 16 deletions(-) copy ui/{ => fontello}/Makefile.am (81%) copy ui/{ => fontello/css}/Makefile.am (81%) copy ui/{ => fontello/font}/Makefile.am (81%) diff --git a/configure.ac b/configure.ac index 0261b5f..9e3edb8 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,9 @@ AC_CONFIG_FILES([ plugins/sample/ui/pages/Makefile ui/Makefile ui/css/Makefile + ui/fontello/Makefile + ui/fontello/css/Makefile + ui/fontello/font/Makefile ui/images/Makefile ui/images/theme-default/Makefile ui/js/Makefile diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in index 8cc63e7..d2c5169 100644 --- a/src/kimchi/config.py.in +++ b/src/kimchi/config.py.in @@ -176,7 +176,7 @@ class UIConfig(dict): def __init__(self, paths): ui_configs = {} - for sub_dir in ('css', 'js', 'libs', 'images'): + for sub_dir in ('css', 'fontello', 'js', 'libs', 'images'): ui_configs['/' + sub_dir] = { 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.join(paths.ui_dir, sub_dir), diff --git a/ui/Makefile.am b/ui/Makefile.am index d541355..adb6ada 100644 --- a/ui/Makefile.am +++ b/ui/Makefile.am @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = css images js libs pages spice-html5 +SUBDIRS = css fontello images js libs pages spice-html5 uidir = $(datadir)/kimchi/ui diff --git a/ui/Makefile.am b/ui/fontello/Makefile.am similarity index 81% copy from ui/Makefile.am copy to ui/fontello/Makefile.am index d541355..0576ed2 100644 --- a/ui/Makefile.am +++ b/ui/fontello/Makefile.am @@ -1,7 +1,7 @@ # # Kimchi # -# Copyright IBM, Corp. 2013 +# Copyright IBM, Corp. 2015 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = css images js libs pages spice-html5 +SUBDIRS = css font -uidir = $(datadir)/kimchi/ui +fontellodir = $(datadir)/wok/ui/fontello -dist_ui_DATA = robots.txt +dist_fontello_DATA = LICENSE.txt diff --git a/ui/Makefile.am b/ui/fontello/css/Makefile.am similarity index 81% copy from ui/Makefile.am copy to ui/fontello/css/Makefile.am index d541355..50b5489 100644 --- a/ui/Makefile.am +++ b/ui/fontello/css/Makefile.am @@ -1,7 +1,7 @@ # # Kimchi # -# Copyright IBM, Corp. 2013 +# Copyright IBM, Corp. 2015 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = css images js libs pages spice-html5 +cssdir = $(datadir)/wok/ui/fontello/css -uidir = $(datadir)/kimchi/ui - -dist_ui_DATA = robots.txt +dist_css_DATA = $(wildcard *.css) $(NULL) diff --git a/ui/Makefile.am b/ui/fontello/font/Makefile.am similarity index 81% copy from ui/Makefile.am copy to ui/fontello/font/Makefile.am index d541355..da9cb66 100644 --- a/ui/Makefile.am +++ b/ui/fontello/font/Makefile.am @@ -1,7 +1,7 @@ # # Kimchi # -# Copyright IBM, Corp. 2013 +# Copyright IBM, Corp. 2015 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = css images js libs pages spice-html5 +fontdir = $(datadir)/wok/ui/fontello/font -uidir = $(datadir)/kimchi/ui - -dist_ui_DATA = robots.txt +dist_font_DATA = $(wildcard fontello.*) $(NULL) -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:36 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:36 -0300 Subject: [Kimchi-devel] [PATCH V3 04/34] Rename kimchi-named files to wok In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-5-git-send-email-luciojhc@linux.vnet.ibm.com> Renames the remaining kimchi-named files in wok to avoid confusion. No code changes. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- ...pstart.conf.debian => wokd-upstart.conf.debian} | 0 ...pstart.conf.fedora => wokd-upstart.conf.fedora} | 0 ...{kimchid.service.fedora => wokd.service.fedora} | 0 contrib/{kimchid.sysvinit => wokd.sysvinit} | 0 docs/{kimchid.8.in => wokd.8.in} | 0 src/nginx/{kimchi.conf.in => wok.conf.in} | 0 src/{kimchi.conf.in => wok.conf.in} | 0 src/{kimchid.in => wokd.in} | 0 .../{kimchi-loading.gif => wok-loading.gif} | Bin 6181 -> 6181 bytes ui/js/src/{kimchi.cookie.js => wok.cookie.js} | 0 ui/js/src/{kimchi.form.js => wok.form.js} | 0 ui/js/src/{kimchi.grid.js => wok.grid.js} | 0 ui/js/src/{kimchi.lang.js => wok.lang.js} | 0 .../{kimchi.line-chart.js => wok.line-chart.js} | 0 ui/js/src/{kimchi.login.js => wok.login.js} | 0 ui/js/src/{kimchi.main.js => wok.main.js} | 0 ui/js/src/{kimchi.message.js => wok.message.js} | 0 ui/js/src/{kimchi.object.js => wok.object.js} | 0 ui/js/src/{kimchi.popable.js => wok.popable.js} | 0 ui/js/src/{kimchi.select.js => wok.select.js} | 0 ui/js/src/{kimchi.string.js => wok.string.js} | 0 .../{kimchi.substitute.js => wok.substitute.js} | 0 ui/js/src/{kimchi.topic.js => wok.topic.js} | 0 ui/js/src/{kimchi.user.js => wok.user.js} | 0 ui/js/src/{kimchi.utils.js => wok.utils.js} | 0 ui/js/src/{kimchi.window.js => wok.window.js} | 0 ui/pages/{kimchi-ui.html.tmpl => wok-ui.html.tmpl} | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename contrib/{kimchid-upstart.conf.debian => wokd-upstart.conf.debian} (100%) rename contrib/{kimchid-upstart.conf.fedora => wokd-upstart.conf.fedora} (100%) rename contrib/{kimchid.service.fedora => wokd.service.fedora} (100%) rename contrib/{kimchid.sysvinit => wokd.sysvinit} (100%) rename docs/{kimchid.8.in => wokd.8.in} (100%) rename src/nginx/{kimchi.conf.in => wok.conf.in} (100%) rename src/{kimchi.conf.in => wok.conf.in} (100%) rename src/{kimchid.in => wokd.in} (100%) rename ui/images/theme-default/{kimchi-loading.gif => wok-loading.gif} (100%) rename ui/js/src/{kimchi.cookie.js => wok.cookie.js} (100%) rename ui/js/src/{kimchi.form.js => wok.form.js} (100%) rename ui/js/src/{kimchi.grid.js => wok.grid.js} (100%) rename ui/js/src/{kimchi.lang.js => wok.lang.js} (100%) rename ui/js/src/{kimchi.line-chart.js => wok.line-chart.js} (100%) rename ui/js/src/{kimchi.login.js => wok.login.js} (100%) rename ui/js/src/{kimchi.main.js => wok.main.js} (100%) rename ui/js/src/{kimchi.message.js => wok.message.js} (100%) rename ui/js/src/{kimchi.object.js => wok.object.js} (100%) rename ui/js/src/{kimchi.popable.js => wok.popable.js} (100%) rename ui/js/src/{kimchi.select.js => wok.select.js} (100%) rename ui/js/src/{kimchi.string.js => wok.string.js} (100%) rename ui/js/src/{kimchi.substitute.js => wok.substitute.js} (100%) rename ui/js/src/{kimchi.topic.js => wok.topic.js} (100%) rename ui/js/src/{kimchi.user.js => wok.user.js} (100%) rename ui/js/src/{kimchi.utils.js => wok.utils.js} (100%) rename ui/js/src/{kimchi.window.js => wok.window.js} (100%) rename ui/pages/{kimchi-ui.html.tmpl => wok-ui.html.tmpl} (100%) diff --git a/contrib/kimchid-upstart.conf.debian b/contrib/wokd-upstart.conf.debian similarity index 100% rename from contrib/kimchid-upstart.conf.debian rename to contrib/wokd-upstart.conf.debian diff --git a/contrib/kimchid-upstart.conf.fedora b/contrib/wokd-upstart.conf.fedora similarity index 100% rename from contrib/kimchid-upstart.conf.fedora rename to contrib/wokd-upstart.conf.fedora diff --git a/contrib/kimchid.service.fedora b/contrib/wokd.service.fedora similarity index 100% rename from contrib/kimchid.service.fedora rename to contrib/wokd.service.fedora diff --git a/contrib/kimchid.sysvinit b/contrib/wokd.sysvinit similarity index 100% rename from contrib/kimchid.sysvinit rename to contrib/wokd.sysvinit diff --git a/docs/kimchid.8.in b/docs/wokd.8.in similarity index 100% rename from docs/kimchid.8.in rename to docs/wokd.8.in diff --git a/src/nginx/kimchi.conf.in b/src/nginx/wok.conf.in similarity index 100% rename from src/nginx/kimchi.conf.in rename to src/nginx/wok.conf.in diff --git a/src/kimchi.conf.in b/src/wok.conf.in similarity index 100% rename from src/kimchi.conf.in rename to src/wok.conf.in diff --git a/src/kimchid.in b/src/wokd.in similarity index 100% rename from src/kimchid.in rename to src/wokd.in diff --git a/ui/js/src/kimchi.cookie.js b/ui/js/src/wok.cookie.js similarity index 100% rename from ui/js/src/kimchi.cookie.js rename to ui/js/src/wok.cookie.js diff --git a/ui/js/src/kimchi.form.js b/ui/js/src/wok.form.js similarity index 100% rename from ui/js/src/kimchi.form.js rename to ui/js/src/wok.form.js diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/wok.grid.js similarity index 100% rename from ui/js/src/kimchi.grid.js rename to ui/js/src/wok.grid.js diff --git a/ui/js/src/kimchi.lang.js b/ui/js/src/wok.lang.js similarity index 100% rename from ui/js/src/kimchi.lang.js rename to ui/js/src/wok.lang.js diff --git a/ui/js/src/kimchi.line-chart.js b/ui/js/src/wok.line-chart.js similarity index 100% rename from ui/js/src/kimchi.line-chart.js rename to ui/js/src/wok.line-chart.js diff --git a/ui/js/src/kimchi.login.js b/ui/js/src/wok.login.js similarity index 100% rename from ui/js/src/kimchi.login.js rename to ui/js/src/wok.login.js diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/wok.main.js similarity index 100% rename from ui/js/src/kimchi.main.js rename to ui/js/src/wok.main.js diff --git a/ui/js/src/kimchi.message.js b/ui/js/src/wok.message.js similarity index 100% rename from ui/js/src/kimchi.message.js rename to ui/js/src/wok.message.js diff --git a/ui/js/src/kimchi.object.js b/ui/js/src/wok.object.js similarity index 100% rename from ui/js/src/kimchi.object.js rename to ui/js/src/wok.object.js diff --git a/ui/js/src/kimchi.popable.js b/ui/js/src/wok.popable.js similarity index 100% rename from ui/js/src/kimchi.popable.js rename to ui/js/src/wok.popable.js diff --git a/ui/js/src/kimchi.select.js b/ui/js/src/wok.select.js similarity index 100% rename from ui/js/src/kimchi.select.js rename to ui/js/src/wok.select.js diff --git a/ui/js/src/kimchi.string.js b/ui/js/src/wok.string.js similarity index 100% rename from ui/js/src/kimchi.string.js rename to ui/js/src/wok.string.js diff --git a/ui/js/src/kimchi.substitute.js b/ui/js/src/wok.substitute.js similarity index 100% rename from ui/js/src/kimchi.substitute.js rename to ui/js/src/wok.substitute.js diff --git a/ui/js/src/kimchi.topic.js b/ui/js/src/wok.topic.js similarity index 100% rename from ui/js/src/kimchi.topic.js rename to ui/js/src/wok.topic.js diff --git a/ui/js/src/kimchi.user.js b/ui/js/src/wok.user.js similarity index 100% rename from ui/js/src/kimchi.user.js rename to ui/js/src/wok.user.js diff --git a/ui/js/src/kimchi.utils.js b/ui/js/src/wok.utils.js similarity index 100% rename from ui/js/src/kimchi.utils.js rename to ui/js/src/wok.utils.js diff --git a/ui/js/src/kimchi.window.js b/ui/js/src/wok.window.js similarity index 100% rename from ui/js/src/kimchi.window.js rename to ui/js/src/wok.window.js diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/wok-ui.html.tmpl similarity index 100% rename from ui/pages/kimchi-ui.html.tmpl rename to ui/pages/wok-ui.html.tmpl -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:38 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:38 -0300 Subject: [Kimchi-devel] [PATCH V3 06/34] Update wok docs In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-7-git-send-email-luciojhc@linux.vnet.ibm.com> - Fix and update COPYING file - Add API and README docs to reflect new changes introduced by wok. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- COPYING | 8 +++--- README.md | 1 + docs/API.md | 46 ++++++++++++++++++++++++++++++++++++++++ docs/README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 4 deletions(-) create mode 120000 README.md create mode 100644 docs/API.md create mode 100644 docs/README.md diff --git a/COPYING b/COPYING index aca8f01..4cc4028 100644 --- a/COPYING +++ b/COPYING @@ -1,9 +1,9 @@ -Kimchi is distributed pursuant to the terms of two different licenses. -The user interface (located in ui/ in this distribution) is governed by -the Apache License version 2.0. +Wok/Kimchi are distributed pursuant to the terms of two different licenses. +The user interface (located in ui/ and plugins/kimchi/ui in this distribution) +is governed by the Apache License version 2.0. Except the imported code under the following directories: -- ui/spice-html5 which is imported from spice-html5 project +- plugins/kimchi/ui/spice-html5 which is imported from spice-html5 project (http://cgit.freedesktop.org/spice/spice-html5); - ui/libs which is imported from JQuery UI (http://jqueryui.com); - ui/fontello which is generated by http://fontello.com open source project. diff --git a/README.md b/README.md new file mode 120000 index 0000000..0e01b43 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +docs/README.md \ No newline at end of file diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..67d966e --- /dev/null +++ b/docs/API.md @@ -0,0 +1,46 @@ +## Wok REST API Specification + +The API provides functionality to the application and may be used directly by +external tools. In the following sections you will find the specification of +all Collections and Resource types that are supported and the URIs where they +can be accessed. In order to use the API effectively, please the following +general conventions: + +* The **Content Type** of the API is JSON. When making HTTP requests to this + API you should specify the following headers: + * Accept: application/json + * Content-type: application/json +* A **Collection** is a group of Resources of a given type. + * A **GET** request retrieves a list of summarized Resource representations + This summary *may* include all or some of the Resource properties but + *must* include a link to the full Resource representation. + * A **POST** request will create a new Resource in the Collection. The set + of Resource properties *must* be specified as a JSON object in the request + body. + * No other HTTP methods are supported for Collections +* A **Resource** is a representation of a singular object in the API (eg. + Virtual Machine). + * A **GET** request retrieves the full Resource representation. + * A **DELETE** request will delete the Resource. This request *may* contain + a JSON object which specifies optional parameters. + * A **PUT** request is used to modify the properties of a Resource (eg. + Change the name of a Virtual Machine). This kind of request *must not* + alter the live state of the Resource. Only *actions* may alter live state. + * A **POST** request commits an *action* upon a Resource (eg. Start a + Virtual Machine). This request is made to a URI relative to the Resource + URI. Available *actions* are described within the *actions* property of a + Resource representation. The request body *must* contain a JSON object + which specifies parameters. +* URIs begin with '/' to indicate Wok server root. + * Variable segments in the URI begin with a ':' and should replaced with the + appropriate resource identifier. + + +### Collection: Plugins + +**URI:** /plugins + +**Methods:** + +* **GET**: Retrieve a summarized list names of all UI Plugins + diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..1b31ccf --- /dev/null +++ b/docs/README.md @@ -0,0 +1,64 @@ +Wok (Webserver Originated from Kimchi) +====================================== + +Wok is a cherrypy-based web framework with HTML5 support that is extended by +plugins which expose functionality through REST APIs. + +Examples of such plugins are Kimchi (Virtualization Management) and Ginger +(System Administration). Wok comes with a sample plugin for education purposes. + +Wok runs through wokd daemon. + + +Build and Install +----------------- + + $ ./autogen.sh --system + $ make + $ sudo make install # Optional if running from the source tree + + +Run +--- + + $ sudo wokd --host=0.0.0.0 + +If you cannot access Wok, take a look at these 2 points: + +1. Firewall +Wok uses by default the ports 8000, 8001 and 64667. To allow incoming connections: + + For system using firewalld, do: + sudo firewall-cmd --add-port=8000/tcp --permanent + sudo firewall-cmd --add-port=8001/tcp --permanent + sudo firewall-cmd --add-port=64667/tcp --permanent + sudo firewall-cmd --reload + + For openSUSE systems, do: + sudo /sbin/SuSEfirewall2 open EXT TCP 8000 + sudo /sbin/SuSEfirewall2 open EXT TCP 8001 + sudo /sbin/SuSEfirewall2 open EXT TCP 64667 + + For system using iptables, do: + sudo iptables -A INPUT -p tcp --dport 8000 -j ACCEPT + sudo iptables -A INPUT -p tcp --dport 8001 -j ACCEPT + sudo iptables -A INPUT -p tcp --dport 64667 -j ACCEPT + + Don't forget to correctly save the rules. + + +2. SELinux +Allow httpd_t context for Wok web server: + + semanage permissive -a httpd_t + + +Participating +------------- + +All patches are sent through our mailing list hosted by oVirt. More +information can be found at: + +https://github.com/kimchi-project/kimchi/wiki/Communications + +Patches should be sent using git-send-email to kimchi-devel at ovirt.org. -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:47 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:47 -0300 Subject: [Kimchi-devel] [PATCH V3 15/34] Setup wok In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-16-git-send-email-luciojhc@linux.vnet.ibm.com> - Add model.py for wok - Add an empty json API to wok - Move some basic Javascript APIs from kimchi - Do not load tabs.xml anymore - Disable wok authentication by default - Rename KimchiRoot to WokRoot - Update default_page to wok-ui.html - Adapt 'sample' plugin - Move hide-content css to wok Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/ui/css/theme-default/storage.css | 4 - plugins/sample/__init__.py | 4 +- src/wok/API.json | 6 ++ src/wok/config.py.in | 1 + src/wok/model/model.py | 49 ++++++++++++ src/wok/root.py | 10 +- src/wok/server.py | 8 +- src/wok/utils.py | 2 +- ui/css/theme-default/topbar.css | 4 + ui/js/src/wok.api.js | 91 +++++++++++++++++++++++ ui/js/src/wok.main.js | 3 +- 11 files changed, 164 insertions(+), 18 deletions(-) create mode 100644 src/wok/API.json create mode 100644 src/wok/model/model.py create mode 100644 ui/js/src/wok.api.js diff --git a/plugins/kimchi/ui/css/theme-default/storage.css b/plugins/kimchi/ui/css/theme-default/storage.css index 31e8f5b..88447b5 100644 --- a/plugins/kimchi/ui/css/theme-default/storage.css +++ b/plugins/kimchi/ui/css/theme-default/storage.css @@ -215,10 +215,6 @@ border: 1px solid rgb(204, 204, 204); } -.hide-content { - display: none!important; -} - .volumeslist { padding: 7px; max-height: 272px; diff --git a/plugins/sample/__init__.py b/plugins/sample/__init__.py index 786832f..3a309a5 100644 --- a/plugins/sample/__init__.py +++ b/plugins/sample/__init__.py @@ -26,7 +26,7 @@ from cherrypy import expose from wok.config import PluginPaths from wok.control.base import Collection, Resource -from wok.root import Root +from wok.root import WokRoot from plugins.sample.i18n import messages from plugins.sample.model import Model @@ -34,7 +34,7 @@ from plugins.sample.model import Model model = Model() -class Drawings(Root): +class Drawings(WokRoot): def __init__(self): Resource.__init__(self, model) self.description = Description(model) diff --git a/src/wok/API.json b/src/wok/API.json new file mode 100644 index 0000000..8965db9 --- /dev/null +++ b/src/wok/API.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "Wok API", + "description": "Json schema for Wok API", + "type": "object" +} diff --git a/src/wok/config.py.in b/src/wok/config.py.in index 3fc46a4..47c9edf 100644 --- a/src/wok/config.py.in +++ b/src/wok/config.py.in @@ -180,6 +180,7 @@ class UIConfig(dict): ui_configs['/' + sub_dir] = { 'tools.staticdir.on': True, 'tools.staticdir.dir': os.path.join(paths.ui_dir, sub_dir), + 'tools.wokauth.on': False, 'tools.nocache.on': False} if sub_dir != 'images': ui_configs['/' + sub_dir].update({ diff --git a/src/wok/model/model.py b/src/wok/model/model.py new file mode 100644 index 0000000..09c4c1e --- /dev/null +++ b/src/wok/model/model.py @@ -0,0 +1,49 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2014-2015 +# +# 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 + +import inspect +import os + +from wok.basemodel import BaseModel +from wok.objectstore import ObjectStore +from wok.utils import import_module, listPathModules + + +class Model(BaseModel): + def __init__(self, objstore_loc=None): + + self.objstore = ObjectStore(objstore_loc) + kargs = {'objstore': self.objstore} + + this = os.path.basename(__file__) + this_mod = os.path.splitext(this)[0] + + models = [] + for mod_name in listPathModules(os.path.dirname(__file__)): + if mod_name.startswith("_") or mod_name == this_mod: + continue + + module = import_module('wok.model.' + mod_name) + members = inspect.getmembers(module, inspect.isclass) + for cls_name, instance in members: + if inspect.getmodule(instance) == module: + if cls_name.endswith('Model'): + models.append(instance(**kargs)) + + return super(Model, self).__init__(models) diff --git a/src/wok/root.py b/src/wok/root.py index a3b8be1..35620c7 100644 --- a/src/wok/root.py +++ b/src/wok/root.py @@ -114,16 +114,16 @@ class Root(Resource): raise cherrypy.HTTPError(404) -class KimchiRoot(Root): - def __init__(self, model, dev_env): - super(KimchiRoot, self).__init__(model, dev_env) - self.default_page = 'kimchi-ui.html' +class WokRoot(Root): + def __init__(self, model, dev_env=False): + super(WokRoot, self).__init__(model, dev_env) + self.default_page = 'wok-ui.html' for ident, node in sub_nodes.items(): setattr(self, ident, node(model)) with open(os.path.join(paths.src_dir, 'API.json')) as f: self.api_schema = json.load(f) self.paths = paths - self.domain = 'kimchi' + self.domain = 'wok' self.messages = messages @cherrypy.expose diff --git a/src/wok/server.py b/src/wok/server.py index 0f99663..ab941e7 100644 --- a/src/wok/server.py +++ b/src/wok/server.py @@ -28,10 +28,10 @@ from wok import config from wok.model import model from wok import mockmodel from wok import vnc -from wok.config import KimchiConfig, PluginConfig +from wok.config import WokConfig, PluginConfig from wok.control import sub_nodes from wok.proxy import start_proxy, terminate_proxy -from wok.root import KimchiRoot +from wok.root import WokRoot from wok.utils import get_enabled_plugins, import_class @@ -73,7 +73,7 @@ class Server(object): if not os.path.isdir(directory): os.makedirs(directory) - self.configObj = KimchiConfig() + self.configObj = WokConfig() # We'll use the session timeout (= 10 minutes) and the # nginx timeout (= 10 minutes). This monitor isn't involved # in anything other than monitor the timeout of the connection, @@ -141,7 +141,7 @@ class Server(object): ident = "/%s" % ident cfg[ident] = {'tools.wokauth.on': True} - self.app = cherrypy.tree.mount(KimchiRoot(model_instance, dev_env), + self.app = cherrypy.tree.mount(WokRoot(model_instance, dev_env), config=self.configObj) self._load_plugins() diff --git a/src/wok/utils.py b/src/wok/utils.py index f5058d5..fc76620 100644 --- a/src/wok/utils.py +++ b/src/wok/utils.py @@ -113,7 +113,7 @@ def get_enabled_plugins(): def get_all_tabs(): - files = [os.path.join(paths.prefix, 'config/ui/tabs.xml')] + files = [] for plugin, _ in get_enabled_plugins(): files.append(os.path.join(PluginPaths(plugin).ui_dir, diff --git a/ui/css/theme-default/topbar.css b/ui/css/theme-default/topbar.css index 9dd5ec1..4fce02c 100644 --- a/ui/css/theme-default/topbar.css +++ b/ui/css/theme-default/topbar.css @@ -208,3 +208,7 @@ a#btn-logout:hover { display: block; padding: 10px; } + +.hide-content { + display: none!important; +} diff --git a/ui/js/src/wok.api.js b/ui/js/src/wok.api.js new file mode 100644 index 0000000..93a07ad --- /dev/null +++ b/ui/js/src/wok.api.js @@ -0,0 +1,91 @@ +/* + * Project Kimchi + * + * Copyright IBM, Corp. 2013-2015 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var wok = { + + widget: {}, + + /** + * A wrapper of jQuery.ajax function to allow custom bindings. + * + * @param settings an extended object to jQuery Ajax settings object + * with some extra properties (see below) + * + * resend: if the XHR has failed due to 401, the XHR can be resent + * after user being authenticated successfully by setting resend + * to true: settings = {resend: true}. It's useful for switching + * pages (Guests, Templates, etc.). + * e.g., the user wants to list guests by clicking Guests tab, + * but he is told not authorized and a login window will pop up. + * After login, the Ajax request for /vms will be resent without + * user clicking the tab again. + * Default to false. + */ + requestJSON : function(settings) { + settings['originalError'] = settings['error']; + settings['error'] = null; + settings['wok'] = true; + return $.ajax(settings); + }, + + /** + * Get the i18 strings. + */ + getI18n: function(suc, err, url, sync) { + wok.requestJSON({ + url : url ? url : 'i18n.json', + type : 'GET', + resend: true, + dataType : 'json', + async : !sync, + success : suc, + error: err + }); + }, + + login : function(settings, suc, err) { + $.ajax({ + url : "login", + type : "POST", + contentType : "application/json", + data : JSON.stringify(settings), + dataType : "json" + }).done(suc).fail(err); + }, + + logout : function(suc, err) { + wok.requestJSON({ + url : 'logout', + type : 'POST', + contentType : "application/json", + dataType : "json" + }).done(suc).fail(err); + }, + + listPlugins : function(suc, err, sync) { + wok.requestJSON({ + url : 'plugins', + type : 'GET', + contentType : 'application/json', + dataType : 'json', + resend: true, + async : !sync, + success : suc, + error : err + }); + }, +}; diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js index 089b523..5b1f1bc 100644 --- a/ui/js/src/wok.main.js +++ b/ui/js/src/wok.main.js @@ -90,12 +90,11 @@ wok.main = function() { return tabs; }; - var tabConfigUrl = 'config/ui/tabs.xml'; var pluginConfigUrl = 'plugins/{plugin}/ui/config/tab-ext.xml'; var pluginI18nUrl = 'plugins/{plugin}/i18n.json'; var DEFAULT_HASH; var buildTabs = function(callback) { - var tabs = retrieveTabs(tabConfigUrl); + var tabs = []; wok.listPlugins(function(plugins) { $(plugins).each(function(i, p) { var url = wok.substitute(pluginConfigUrl, { -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:48 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:48 -0300 Subject: [Kimchi-devel] [PATCH V3 16/34] Setup kimchi plugin In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-17-git-send-email-luciojhc@linux.vnet.ibm.com> - Create root.py, kimchi.conf and config.py.in in plugin - Adjust tabs-ext.xml - Move kimchi specific config/API from wok to plugin - Move mockmodel stuff to plugin - Create mechanism to load plugin-specific config through get_custom_conf() method in plugin root and use it for novnc/spice config moved to new classes KimchiPaths and KimchiConfig - Pass all server options in plugins initalization - Adapt sample plugin to receive server options - Drop server-specific functions from kimchi plugin - Move kimchi-specific URI functions to plugin - Move capabilities to kimchi plugin Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/__init__.py | 21 +++ plugins/kimchi/config.py.in | 139 ++++++++++++++++++++ plugins/kimchi/kimchi.conf | 45 +++++++ plugins/kimchi/root.py | 70 ++++++++++ plugins/kimchi/ui/config/tab-ext.xml | 14 +- plugins/kimchi/ui/js/src/kimchi.api.js | 55 -------- plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js | 6 +- plugins/kimchi/ui/js/src/kimchi.host.js | 12 +- plugins/kimchi/ui/js/src/kimchi.main.js | 26 ++++ .../ui/js/src/kimchi.repository_edit_main.js | 4 +- .../kimchi/ui/js/src/kimchi.template_add_main.js | 4 +- .../kimchi/ui/js/src/kimchi.template_edit_main.js | 4 +- plugins/kimchi/utils.py | 40 ++++++ plugins/sample/__init__.py | 2 +- src/wok/config.py.in | 122 ----------------- src/wok/server.py | 25 ++-- src/wok/utils.py | 16 --- ui/js/src/wok.main.js | 10 -- 18 files changed, 374 insertions(+), 241 deletions(-) create mode 100644 plugins/kimchi/__init__.py create mode 100644 plugins/kimchi/config.py.in create mode 100644 plugins/kimchi/kimchi.conf create mode 100644 plugins/kimchi/root.py create mode 100644 plugins/kimchi/ui/js/src/kimchi.main.js create mode 100644 plugins/kimchi/utils.py diff --git a/plugins/kimchi/__init__.py b/plugins/kimchi/__init__.py new file mode 100644 index 0000000..9330044 --- /dev/null +++ b/plugins/kimchi/__init__.py @@ -0,0 +1,21 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2014 +# +# 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 root import KimchiRoot +__all__ = [KimchiRoot] diff --git a/plugins/kimchi/config.py.in b/plugins/kimchi/config.py.in new file mode 100644 index 0000000..80b72bd --- /dev/null +++ b/plugins/kimchi/config.py.in @@ -0,0 +1,139 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2015 +# +# 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 +# + +import libvirt +import os +import platform +import threading + +from wok.config import PluginPaths +from wok.xmlutils.utils import xpath_get_text + +kimchiLock = threading.Lock() + +__with_spice__ = "@withspice@" + +# Storage pool constant for read-only pool types +READONLY_POOL_TYPE = ['iscsi', 'scsi', 'mpath'] + + +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') + + +def find_qemu_binary(find_emulator=False): + try: + connect = libvirt.open(None) + except Exception, e: + raise Exception("Unable to get qemu binary location: %s" % e) + try: + xml = connect.getCapabilities() + + # On Little Endian system, the qemu binary is + # qemu-system-ppc64, not qemu-system-ppc64le as expected + arch = platform.machine() + if arch == "ppc64le": + arch = "ppc64" + + if find_emulator: + expr = "/capabilities/guest/arch[@name='%s']\ + /emulator" % arch + else: + expr = "/capabilities/guest/arch[@name='%s']\ + /domain[@type='kvm']/emulator" % arch + res = xpath_get_text(xml, expr) + location = res[0] + except Exception, e: + raise Exception("Unable to get qemu binary location: %s" % e) + finally: + connect.close() + return location + + +class KimchiPaths(PluginPaths): + + def __init__(self): + super(KimchiPaths, self).__init__('kimchi') + self.spice_file = os.path.join(self.ui_dir, + 'spice-html5/pages/spice_auto.html') + + if __with_spice__ == 'yes': + self.spice_dir = self.add_prefix('ui/spice-html5') + elif os.path.exists('@datadir@/spice-html5'): + self.spice_dir = '@datadir@/spice-html5' + else: + self.spice_dir = '/usr/share/spice-html5' + + if os.path.exists('@datadir@/novnc'): + self.novnc_dir = '@datadir@/novnc' + else: + self.novnc_dir = '/usr/share/novnc' + + if self.installed: + self.spice_css_file = os.path.join(self.spice_dir, 'spice.css') + else: + self.spice_css_file = os.path.join(self.spice_dir, 'css/spice.css') + + +kimchiPaths = KimchiPaths() + + +class KimchiConfig(dict): + def __init__(self): + super(KimchiConfig, self).__init__(self) + + custom_config = { + '/novnc': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': kimchiPaths.novnc_dir, + 'tools.nocache.on': True, + 'tools.wokauth.on': True, + }, + + '/spice_auto.html': { + 'tools.staticfile.on': True, + 'tools.staticfile.filename': kimchiPaths.spice_file, + 'tools.nocache.on': True, + 'tools.wokauth.on': True, + }, + + '/spice-html5': { + 'tools.staticdir.on': True, + 'tools.staticdir.dir': kimchiPaths.spice_dir, + 'tools.nocache.on': True, + }, + + '/spice-html5/spice.css': { + 'tools.staticfile.on': True, + 'tools.staticfile.filename': kimchiPaths.spice_css_file, + 'tools.nocache.on': True, + }, + } + + self.update(custom_config) + diff --git a/plugins/kimchi/kimchi.conf b/plugins/kimchi/kimchi.conf new file mode 100644 index 0000000..1e0ee6b --- /dev/null +++ b/plugins/kimchi/kimchi.conf @@ -0,0 +1,45 @@ +[wok] +enable = True +plugin_class = "KimchiRoot" +uri = "/plugins/kimchi" + +[/] +tools.trailing_slash.on = False +request.methods_with_bodies = ('POST', 'PUT') +tools.nocache.on = True +tools.proxy.on = True +tools.sessions.on = True +tools.sessions.name = 'wok' +tools.sessions.secure = True +tools.sessions.httponly = True +tools.sessions.locking = 'explicit' +tools.sessions.storage_type = 'ram' +tools.sessions.timeout = 10 +tools.wokauth.on = True + +[/data/screenshots] +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' + +[/robots.txt] +tools.staticfile.on = True +tools.staticfile.filename = wok.config.PluginPaths('kimchi').ui_dir + '/robots.txt' + +[/help] +tools.staticdir.on = True +tools.staticdir.dir = wok.config.PluginPaths('kimchi').ui_dir + '/pages/help' +tools.nocache.on = True +tools.staticdir.index = 'en_US/index.html' + diff --git a/plugins/kimchi/root.py b/plugins/kimchi/root.py new file mode 100644 index 0000000..9889926 --- /dev/null +++ b/plugins/kimchi/root.py @@ -0,0 +1,70 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2015 +# +# 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 + +import json +import os +import cherrypy + + +import config +import mockmodel +from control import sub_nodes +from wok.i18n import messages +from model import model as kimchiModel +from wok.root import WokRoot +from wok import vnc + + +class KimchiRoot(WokRoot): + def __init__(self, wok_options): + if hasattr(wok_options, "model"): + self.model = wok_options.model + elif wok_options.test: + self.model = mockmodel.MockModel() + else: + self.model = kimchiModel.Model() + + dev_env = wok_options.environment != 'production' + super(KimchiRoot, self).__init__(self.model, dev_env) + + for ident, node in sub_nodes.items(): + setattr(self, ident, node(self.model)) + + if isinstance(self.model, kimchiModel.Model): + vnc_ws_proxy = vnc.new_ws_proxy() + cherrypy.engine.subscribe('exit', vnc_ws_proxy.terminate) + + self.api_schema = json.load(open(os.path.join(os.path.dirname( + os.path.abspath(__file__)), 'API.json'))) + self.paths = config.kimchiPaths + self.domain = 'kimchi' + self.messages = messages + + 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: + if not os.path.isdir(directory): + os.makedirs(directory) + + def get_custom_conf(self): + return config.KimchiConfig() + diff --git a/plugins/kimchi/ui/config/tab-ext.xml b/plugins/kimchi/ui/config/tab-ext.xml index f79684c..ee88c88 100644 --- a/plugins/kimchi/ui/config/tab-ext.xml +++ b/plugins/kimchi/ui/config/tab-ext.xml @@ -1,38 +1,38 @@ - + Host - tabs/host.html + plugins/kimchi/host.html Guests - tabs/guests.html + plugins/kimchi/guests.html Templates - tabs/templates.html + plugins/kimchi/templates.html Storage - tabs/storage.html + plugins/kimchi/storage.html Network - tabs/network.html + plugins/kimchi/network.html - + diff --git a/plugins/kimchi/ui/js/src/kimchi.api.js b/plugins/kimchi/ui/js/src/kimchi.api.js index d4d0c83..0ec3747 100644 --- a/plugins/kimchi/ui/js/src/kimchi.api.js +++ b/plugins/kimchi/ui/js/src/kimchi.api.js @@ -22,29 +22,6 @@ var kimchi = { trackingTasks: [], /** - * A wrapper of jQuery.ajax function to allow custom bindings. - * - * @param settings an extended object to jQuery Ajax settings object - * with some extra properties (see below) - * - * resend: if the XHR has failed due to 401, the XHR can be resent - * after user being authenticated successfully by setting resend - * to true: settings = {resend: true}. It's useful for switching - * pages (Guests, Templates, etc.). - * e.g., the user wants to list guests by clicking Guests tab, - * but he is told not authorized and a login window will pop up. - * After login, the Ajax request for /vms will be resent without - * user clicking the tab again. - * Default to false. - */ - requestJSON : function(settings) { - settings['originalError'] = settings['error']; - settings['error'] = null; - settings['kimchi'] = true; - return $.ajax(settings); - }, - - /** * * Get host capabilities * suc: callback if succeed err: callback if failed @@ -569,25 +546,6 @@ var kimchi = { }); }, - login : function(settings, suc, err) { - $.ajax({ - url : "login", - type : "POST", - contentType : "application/json", - data : JSON.stringify(settings), - dataType : "json" - }).done(suc).fail(err); - }, - - logout : function(suc, err) { - kimchi.requestJSON({ - url : 'logout', - type : 'POST', - contentType : "application/json", - dataType : "json" - }).done(suc).fail(err); - }, - deleteStoragePool : function(poolName, suc, err) { $.ajax({ url : 'plugins/kimchi/storagepools/' + encodeURIComponent(poolName), @@ -611,19 +569,6 @@ var kimchi = { }); }, - listPlugins : function(suc, err, sync) { - kimchi.requestJSON({ - url : 'plugins', - type : 'GET', - contentType : 'application/json', - dataType : 'json', - resend: true, - async : !sync, - success : suc, - error : err - }); - }, - listNetworks : function(suc, err) { wok.requestJSON({ url : 'plugins/kimchi/networks', diff --git a/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js b/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js index 25e3703..7105c88 100644 --- a/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js +++ b/plugins/kimchi/ui/js/src/kimchi.guest_edit_main.js @@ -314,7 +314,7 @@ kimchi.guest_edit_main = function() { }; //set up for PAM var userNodes = {}, groupNodes = {}; - authType = wok.capabilities['auth'] + authType = kimchi.capabilities['auth'] if (authType == 'pam') { $("#form-guest-edit-permission .ldap").hide(); kimchi.retrieveVM(kimchi.selectedGuest, function(vm){ @@ -432,7 +432,7 @@ kimchi.guest_edit_main = function() { var setupPCIDevice = function(){ kimchi.getHostPCIDevices(function(hostPCIs){ kimchi.getVMPCIDevices(kimchi.selectedGuest, function(vmPCIs){ - var pciEnabled = wok.capabilities.kernel_vfio; + var pciEnabled = kimchi.capabilities.kernel_vfio; for(var i=0; iSpice'); wok.select('template-edit-graphics-list', vncOpt); var enableSpice = function() { - if (wok.capabilities == undefined) { + if (kimchi.capabilities == undefined) { setTimeout(enableSpice, 2000); return; } - if (wok.capabilities.qemu_spice == true) { + if (kimchi.capabilities.qemu_spice == true) { spiceOpt = [{label: 'Spice', value: 'spice'}] wok.select('template-edit-graphics-list', spiceOpt); } diff --git a/plugins/kimchi/utils.py b/plugins/kimchi/utils.py new file mode 100644 index 0000000..dc00481 --- /dev/null +++ b/plugins/kimchi/utils.py @@ -0,0 +1,40 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2015 +# +# 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 +# + +import re + +from wok.exception import InvalidParameter + + +def _uri_to_name(collection, uri): + expr = '/plugins/kimchi/%s/(.*?)$' % collection + m = re.match(expr, uri) + if not m: + raise InvalidParameter("KCHUTILS0001E", {'uri': uri}) + return m.group(1) + + +def template_name_from_uri(uri): + return _uri_to_name('templates', uri) + + +def pool_name_from_uri(uri): + return _uri_to_name('storagepools', uri) + diff --git a/plugins/sample/__init__.py b/plugins/sample/__init__.py index 3a309a5..a2cfbf2 100644 --- a/plugins/sample/__init__.py +++ b/plugins/sample/__init__.py @@ -35,7 +35,7 @@ model = Model() class Drawings(WokRoot): - def __init__(self): + def __init__(self, wok_options): Resource.__init__(self, model) self.description = Description(model) self.rectangles = Rectangles(model) diff --git a/src/wok/config.py.in b/src/wok/config.py.in index 47c9edf..558eceb 100644 --- a/src/wok/config.py.in +++ b/src/wok/config.py.in @@ -18,98 +18,32 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -import libvirt import os -import platform -import threading from ConfigParser import SafeConfigParser -from kimchi.xmlutils.utils import xpath_get_text - __version__ = "@wokversion@" __release__ = "@wokrelease@" -__with_spice__ = "@withspice@" DEFAULT_LOG_LEVEL = "debug" -kimchiLock = threading.Lock() - -# Storage pool constant for read-only pool types -READONLY_POOL_TYPE = ['iscsi', 'scsi', 'mpath'] - def get_object_store(): return os.path.join(paths.state_dir, 'objectstore') -def get_distros_store(): - return os.path.join(paths.conf_dir, 'distros.d') - - -def get_screenshot_path(): - return os.path.join(paths.state_dir, 'screenshots') - - -def get_debugreports_path(): - return os.path.join(paths.state_dir, 'debugreports') - - def get_version(): return "-".join([__version__, __release__]) -def find_qemu_binary(find_emulator=False): - try: - connect = libvirt.open(None) - except Exception, e: - raise Exception("Unable to get qemu binary location: %s" % e) - try: - xml = connect.getCapabilities() - - # On Little Endian system, the qemu binary is - # qemu-system-ppc64, not qemu-system-ppc64le as expected - arch = platform.machine() - if arch == "ppc64le": - arch = "ppc64" - - if find_emulator: - expr = "/capabilities/guest/arch[@name='%s']\ - /emulator" % arch - else: - expr = "/capabilities/guest/arch[@name='%s']\ - /domain[@type='kvm']/emulator" % arch - res = xpath_get_text(xml, expr) - location = res[0] - except Exception, e: - raise Exception("Unable to get qemu binary location: %s" % e) - finally: - connect.close() - return location - - class Paths(object): def __init__(self): self.prefix = self.get_prefix() self.installed = (self.prefix == '@pkgdatadir@') self.ui_dir = self.add_prefix('ui') - self.spice_file = os.path.join(self.ui_dir, - 'spice-html5/pages/spice_auto.html') - - if __with_spice__ == 'yes': - self.spice_dir = self.add_prefix('ui/spice-html5') - elif os.path.exists('@datadir@/spice-html5'): - self.spice_dir = '@datadir@/spice-html5' - else: - self.spice_dir = '/usr/share/spice-html5' - - if os.path.exists('@datadir@/novnc'): - self.novnc_dir = '@datadir@/novnc' - else: - self.novnc_dir = '/usr/share/novnc' if self.installed: self.nginx_conf_dir = '@sysconfdir@/nginx/conf.d' @@ -119,7 +53,6 @@ class Paths(object): self.src_dir = '@wokdir@' self.plugins_dir = '@wokdir@/plugins' self.mo_dir = '@prefix@/share/locale' - self.spice_css_file = os.path.join(self.spice_dir, 'spice.css') else: self.nginx_conf_dir = self.add_prefix('src/nginx') self.state_dir = self.add_prefix('data') @@ -128,7 +61,6 @@ class Paths(object): self.src_dir = self.add_prefix('src/wok') self.plugins_dir = self.add_prefix('plugins') self.mo_dir = self.add_prefix('mo') - self.spice_css_file = os.path.join(self.spice_dir, 'css/spice.css') def get_prefix(self): if __file__.startswith("/"): @@ -208,63 +140,9 @@ class WokConfig(dict): 'tools.sessions.timeout': SESSIONSTIMEOUT, 'tools.wokauth.on': False }, - '/novnc': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': paths.novnc_dir, - 'tools.nocache.on': True, - 'tools.wokauth.on': True - }, - '/spice_auto.html': { - 'tools.staticfile.on': True, - 'tools.staticfile.filename': paths.spice_file, - 'tools.nocache.on': True, - 'tools.kimchiauth.on': True - }, - '/spice-html5': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': paths.spice_dir, - 'tools.nocache.on': True - }, - '/spice-html5/spice.css': { - 'tools.staticfile.on': True, - 'tools.staticfile.filename': paths.spice_css_file, - 'tools.nocache.on': True, - }, '/wok-ui.html': { 'tools.wokauth.on': True }, - '/data/screenshots': { - 'tools.staticdir.on': True, - '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.kimchiauth.on': True, - 'tools.staticdir.content_types': {'xz': 'application/x-xz'} - }, - '/config/ui/tabs.xml': { - 'tools.staticfile.on': True, - 'tools.staticfile.filename': '%s/config/ui/tabs.xml' % - paths.prefix, - 'tools.nocache.on': True - }, - '/favicon.ico': { - 'tools.staticfile.on': True, - 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir - }, - '/robots.txt': { - 'tools.staticfile.on': True, - 'tools.staticfile.filename': '%s/robots.txt' % paths.ui_dir - }, - '/help': { - 'tools.staticdir.on': True, - 'tools.staticdir.dir': '%s/ui/pages/help' % paths.prefix, - 'tools.staticdir.index': 'en_US/index.html', - 'tools.nocache.on': True - } } def __init__(self): diff --git a/src/wok/server.py b/src/wok/server.py index ab941e7..ba81308 100644 --- a/src/wok/server.py +++ b/src/wok/server.py @@ -26,8 +26,6 @@ import os from wok import auth from wok import config from wok.model import model -from wok import mockmodel -from wok import vnc from wok.config import WokConfig, PluginConfig from wok.control import sub_nodes from wok.proxy import start_proxy, terminate_proxy @@ -64,10 +62,7 @@ class Server(object): make_dirs = [ os.path.dirname(os.path.abspath(options.access_log)), os.path.dirname(os.path.abspath(options.error_log)), - os.path.dirname(os.path.abspath(config.get_object_store())), - os.path.abspath(config.get_screenshot_path()), - os.path.abspath(config.get_debugreports_path()), - os.path.abspath(config.get_distros_store()) + os.path.dirname(os.path.abspath(config.get_object_store())) ] for directory in make_dirs: if not os.path.isdir(directory): @@ -126,15 +121,9 @@ class Server(object): if hasattr(options, 'model'): model_instance = options.model - elif options.test: - model_instance = mockmodel.MockModel() else: model_instance = model.Model() - if isinstance(model_instance, model.Model): - vnc_ws_proxy = vnc.new_ws_proxy() - cherrypy.engine.subscribe('exit', vnc_ws_proxy.terminate) - for ident, node in sub_nodes.items(): if node.url_auth: cfg = self.configObj @@ -143,14 +132,14 @@ class Server(object): self.app = cherrypy.tree.mount(WokRoot(model_instance, dev_env), config=self.configObj) - self._load_plugins() + self._load_plugins(options) # Terminate proxy when cherrypy server is terminated cherrypy.engine.subscribe('exit', terminate_proxy) cherrypy.lib.sessions.init() - def _load_plugins(self): + def _load_plugins(self, options): for plugin_name, plugin_config in get_enabled_plugins(): try: plugin_class = ('plugins.%s.%s' % @@ -164,11 +153,17 @@ class Server(object): continue try: - plugin_app = import_class(plugin_class)() + plugin_app = import_class(plugin_class)(options) except ImportError: cherrypy.log.error_log.error("Failed to import plugin %s" % plugin_class) continue + + # dynamically extend plugin config with custom data, if provided + get_custom_conf = getattr(plugin_app, "get_custom_conf", None) + if get_custom_conf is not None: + plugin_config.update(get_custom_conf()) + cherrypy.tree.mount(plugin_app, script_name, plugin_config) def start(self): diff --git a/src/wok/utils.py b/src/wok/utils.py index fc76620..af0d200 100644 --- a/src/wok/utils.py +++ b/src/wok/utils.py @@ -44,22 +44,6 @@ wok_log = cherrypy.log.error_log task_id = 0 -def _uri_to_name(collection, uri): - expr = '/%s/(.*?)$' % collection - m = re.match(expr, uri) - if not m: - raise InvalidParameter("KCHUTILS0001E", {'uri': uri}) - return m.group(1) - - -def template_name_from_uri(uri): - return _uri_to_name('templates', uri) - - -def pool_name_from_uri(uri): - return _uri_to_name('storagepools', uri) - - def get_next_task_id(): global task_id task_id += 1 diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js index 5b1f1bc..b7797dd 100644 --- a/ui/js/src/wok.main.js +++ b/ui/js/src/wok.main.js @@ -17,16 +17,6 @@ */ wok.tabMode = {}; -wok.capabilities = undefined; -wok.getCapabilities(function(result) { - wok.capabilities = result; - - if(wok.capabilities.federation=="on") - $('#peers').removeClass('hide-content'); -}, function() { - wok.capabilities = {}; -}); - wok.main = function() { wok.isLoggingOut = false; wok.popable(); -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:49 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:49 -0300 Subject: [Kimchi-devel] [PATCH V3 17/34] Use InternalRedirect for all plugin redirects In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-18-git-send-email-luciojhc@linux.vnet.ibm.com> The attribute self.uri_fmt is used both with HTTPRedirect and InternalRedirect calls. In the new plugin structure, it is necessary to make all redirects uniform, since InternalRedirect is relative to current path (i.e. /plugins/kimchi) and HTTPRedirect is not. This patch converts all plugin redirects to use InternalRedirect, since it is less costly. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- src/wok/control/base.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wok/control/base.py b/src/wok/control/base.py index 8cfa51c..65a6fee 100644 --- a/src/wok/control/base.py +++ b/src/wok/control/base.py @@ -64,12 +64,12 @@ class Resource(object): if arg is None: arg = '' uri_params.append(urllib2.quote(arg.encode('utf-8'), safe="")) - raise cherrypy.HTTPRedirect(self.uri_fmt % tuple(uri_params), code) + raise internal_redirect(self.uri_fmt % tuple(uri_params)) elif action_result is not None and action_result != self.ident: uri_params = list(self.model_args[:-1]) uri_params += [urllib2.quote(action_result.encode('utf-8'), safe="")] - raise cherrypy.HTTPRedirect(self.uri_fmt % tuple(uri_params), code) + raise internal_redirect(self.uri_fmt % tuple(uri_params)) def generate_action_handler(self, action_name, action_args=None, destructive=False): -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:50 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:50 -0300 Subject: [Kimchi-devel] [PATCH V3 18/34] Dynamically add authed URLs to plugin conf In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-19-git-send-email-luciojhc@linux.vnet.ibm.com> This patch implements the loading of URL subnodes in Kimchi plugin and makes it available to any plugin that wants to use it, through the extra_auth_api_class conf attribute. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/kimchi.conf | 1 + src/wok/server.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/plugins/kimchi/kimchi.conf b/plugins/kimchi/kimchi.conf index 1e0ee6b..bf5efc5 100644 --- a/plugins/kimchi/kimchi.conf +++ b/plugins/kimchi/kimchi.conf @@ -2,6 +2,7 @@ enable = True plugin_class = "KimchiRoot" uri = "/plugins/kimchi" +extra_auth_api_class = "control.sub_nodes" [/] tools.trailing_slash.on = False diff --git a/src/wok/server.py b/src/wok/server.py index ba81308..0a836a2 100644 --- a/src/wok/server.py +++ b/src/wok/server.py @@ -145,6 +145,8 @@ class Server(object): plugin_class = ('plugins.%s.%s' % (plugin_name, plugin_config['wok']['plugin_class'])) + extra_auth = plugin_config['wok'].get('extra_auth_api_class', + None) script_name = plugin_config['wok']['uri'] del plugin_config['wok'] @@ -164,6 +166,24 @@ class Server(object): if get_custom_conf is not None: plugin_config.update(get_custom_conf()) + # dynamically add tools.wokauth.on = True to extra plugin APIs + if extra_auth: + try: + authed_apis = import_class(('plugins.%s.%s' % (plugin_name, + extra_auth))) + except ImportError: + cherrypy.log.error_log.error("Failed to import subnodes " + "for plugin %s" % plugin_class) + continue + + urlSubNodes = {} + for ident, node in authed_apis.items(): + if node.url_auth: + ident = "/%s" % ident + urlSubNodes[ident] = {'tools.wokauth.on': True} + + plugin_config.update(urlSubNodes) + cherrypy.tree.mount(plugin_app, script_name, plugin_config) def start(self): -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:51 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:51 -0300 Subject: [Kimchi-devel] [PATCH V3 19/34] Do not use tabs dir for kimchi plugin html templates In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-20-git-send-email-luciojhc@linux.vnet.ibm.com> This patch standardizes kimchi plugin tmpl files location to be similar of other plugins. It only moves tmpl files from plugins/kimchi/ui/pages/tabs to plugins/kimchi/ui/pages and updates respective Makefiles. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/ui/pages/Makefile.am | 2 +- .../kimchi/ui/pages/{tabs => }/guests.html.tmpl | 0 plugins/kimchi/ui/pages/{tabs => }/host.html.tmpl | 0 .../kimchi/ui/pages/{tabs => }/network.html.tmpl | 0 .../kimchi/ui/pages/{tabs => }/storage.html.tmpl | 0 plugins/kimchi/ui/pages/tabs/Makefile.am | 20 -------------------- .../kimchi/ui/pages/{tabs => }/templates.html.tmpl | 0 7 files changed, 1 insertions(+), 21 deletions(-) rename plugins/kimchi/ui/pages/{tabs => }/guests.html.tmpl (100%) rename plugins/kimchi/ui/pages/{tabs => }/host.html.tmpl (100%) rename plugins/kimchi/ui/pages/{tabs => }/network.html.tmpl (100%) rename plugins/kimchi/ui/pages/{tabs => }/storage.html.tmpl (100%) delete mode 100644 plugins/kimchi/ui/pages/tabs/Makefile.am rename plugins/kimchi/ui/pages/{tabs => }/templates.html.tmpl (100%) diff --git a/plugins/kimchi/ui/pages/Makefile.am b/plugins/kimchi/ui/pages/Makefile.am index 076b814..56288e3 100644 --- a/plugins/kimchi/ui/pages/Makefile.am +++ b/plugins/kimchi/ui/pages/Makefile.am @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -SUBDIRS = help tabs +SUBDIRS = help htmldir = $(datadir)/wok/plugins/kimchi/ui/pages diff --git a/plugins/kimchi/ui/pages/tabs/guests.html.tmpl b/plugins/kimchi/ui/pages/guests.html.tmpl similarity index 100% rename from plugins/kimchi/ui/pages/tabs/guests.html.tmpl rename to plugins/kimchi/ui/pages/guests.html.tmpl diff --git a/plugins/kimchi/ui/pages/tabs/host.html.tmpl b/plugins/kimchi/ui/pages/host.html.tmpl similarity index 100% rename from plugins/kimchi/ui/pages/tabs/host.html.tmpl rename to plugins/kimchi/ui/pages/host.html.tmpl diff --git a/plugins/kimchi/ui/pages/tabs/network.html.tmpl b/plugins/kimchi/ui/pages/network.html.tmpl similarity index 100% rename from plugins/kimchi/ui/pages/tabs/network.html.tmpl rename to plugins/kimchi/ui/pages/network.html.tmpl diff --git a/plugins/kimchi/ui/pages/tabs/storage.html.tmpl b/plugins/kimchi/ui/pages/storage.html.tmpl similarity index 100% rename from plugins/kimchi/ui/pages/tabs/storage.html.tmpl rename to plugins/kimchi/ui/pages/storage.html.tmpl diff --git a/plugins/kimchi/ui/pages/tabs/Makefile.am b/plugins/kimchi/ui/pages/tabs/Makefile.am deleted file mode 100644 index 4d5d33e..0000000 --- a/plugins/kimchi/ui/pages/tabs/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# -# Kimchi -# -# Copyright IBM, Corp. 2013 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -tabshtmldir = $(datadir)/wok/plugins/kimchi/ui/pages/tabs - -dist_tabshtml_DATA = $(wildcard *.html.tmpl) $(NULL) diff --git a/plugins/kimchi/ui/pages/tabs/templates.html.tmpl b/plugins/kimchi/ui/pages/templates.html.tmpl similarity index 100% rename from plugins/kimchi/ui/pages/tabs/templates.html.tmpl rename to plugins/kimchi/ui/pages/templates.html.tmpl -- 1.7.1 From luciojhc at linux.vnet.ibm.com Wed Jul 8 19:17:52 2015 From: luciojhc at linux.vnet.ibm.com (Lucio Correia) Date: Wed, 8 Jul 2015 16:17:52 -0300 Subject: [Kimchi-devel] [PATCH V3 20/34] Refer to kimchi plugin specific js/css in htmls In-Reply-To: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> References: <1436383086-19140-1-git-send-email-luciojhc@linux.vnet.ibm.com> Message-ID: <1436383086-19140-21-git-send-email-luciojhc@linux.vnet.ibm.com> Since wok-ui.html now uses only wok-specific JavaScript and CSS, it is necessary to include kimchi-specific code into kimchi htmls. Signed-off-by: Lucio Correia Signed-off-by: Gustavo Y. Ribeiro --- plugins/kimchi/ui/pages/guests.html.tmpl | 9 +++++++++ plugins/kimchi/ui/pages/host.html.tmpl | 9 +++++++++ plugins/kimchi/ui/pages/network.html.tmpl | 4 ++++ plugins/kimchi/ui/pages/storage.html.tmpl | 4 ++++ plugins/kimchi/ui/pages/templates.html.tmpl | 4 ++++ 5 files changed, 30 insertions(+), 0 deletions(-) diff --git a/plugins/kimchi/ui/pages/guests.html.tmpl b/plugins/kimchi/ui/pages/guests.html.tmpl index b96dd21..b8a1259 100644 --- a/plugins/kimchi/ui/pages/guests.html.tmpl +++ b/plugins/kimchi/ui/pages/guests.html.tmpl @@ -26,6 +26,13 @@ #silent ht = Template + + + + + + +
    + + diff --git a/plugins/kimchi/ui/pages/host.html.tmpl b/plugins/kimchi/ui/pages/host.html.tmpl index 192a7eb..d87debc 100644 --- a/plugins/kimchi/ui/pages/host.html.tmpl +++ b/plugins/kimchi/ui/pages/host.html.tmpl @@ -22,6 +22,13 @@ #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True) #silent _ = t.gettext #silent _t = t.gettext + + + + + + +
    @@ -166,3 +173,5 @@ + + diff --git a/plugins/kimchi/ui/pages/network.html.tmpl b/plugins/kimchi/ui/pages/network.html.tmpl index 8d72f77..915feac 100644 --- a/plugins/kimchi/ui/pages/network.html.tmpl +++ b/plugins/kimchi/ui/pages/network.html.tmpl @@ -24,6 +24,10 @@ #silent _t = t.gettext + + + +