[PATCH] Fix import path based on new plugin structure
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/wok/plugins/kimchi/model/templates.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/wok/plugins/kimchi/model/templates.py b/src/wok/plugins/kimchi/model/templates.py
index b6fb84e..5c1b0c0 100644
--- a/src/wok/plugins/kimchi/model/templates.py
+++ b/src/wok/plugins/kimchi/model/templates.py
@@ -123,8 +123,8 @@ class TemplatesModel(object):
if not tmp_volumes:
raise InvalidParameter("KCHTMPL0018E")
- storagevolumes = __import__("kimchi.model.storagevolumes",
- fromlist=[''])
+ storagevolumes = __import__(
+ "wok.plugins.kimchi.model.storagevolumes", fromlist=[''])
pool_volumes = storagevolumes.StorageVolumesModel(
**kwargs).get_list(pool_name)
vols = set(tmp_volumes) - set(pool_volumes)
--
2.1.0
9 years, 2 months
[PATCH] Update Wok and Kimchi systemd process.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Create kimchid.service.fedora as additional configuration of wokd.service to
set the correct start-up of Kimchi dependencies. Also, removed libvirtd.service
as dependency of Wok.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
contrib/wokd.service.fedora | 2 --
src/wok/plugins/kimchi/Makefile.am | 9 ++++++++-
src/wok/plugins/kimchi/configure.ac | 9 +++++++++
src/wok/plugins/kimchi/contrib/Makefile.am | 6 +++++-
src/wok/plugins/kimchi/contrib/kimchid.service.fedora | 7 +++++++
5 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 src/wok/plugins/kimchi/contrib/kimchid.service.fedora
diff --git a/contrib/wokd.service.fedora b/contrib/wokd.service.fedora
index 023b1af..33d88d8 100644
--- a/contrib/wokd.service.fedora
+++ b/contrib/wokd.service.fedora
@@ -1,7 +1,5 @@
[Unit]
Description=Wok - Webserver Originated from Kimchi
-Requires=libvirtd.service
-After=libvirtd.service
[Service]
Type=simple
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 34ddef4..236e96f 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -1,7 +1,7 @@
#
# Kimchi
#
-# Copyright IBM Corp, 2013
+# 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
@@ -139,6 +139,10 @@ ChangeLog:
fi
install-data-local:
+ @if test -d "$(systemdsystemunitdir)" ; then \
+ mkdir -p $(DESTDIR)/etc/systemd/system/wokd.service.d; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
+ fi; \
$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/wok/
touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)$(kimchidir)
@@ -147,6 +151,9 @@ install-data-local:
mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/{debugreports,isos,screenshots}
uninstall-local:
+ @if test -f $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; then \
+ $(RM) $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
+ fi; \
$(RM) $(DESTDIR)$(kimchidir)/API.json
$(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi
diff --git a/src/wok/plugins/kimchi/configure.ac b/src/wok/plugins/kimchi/configure.ac
index adab45b..6b334c6 100644
--- a/src/wok/plugins/kimchi/configure.ac
+++ b/src/wok/plugins/kimchi/configure.ac
@@ -64,6 +64,15 @@ 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],
diff --git a/src/wok/plugins/kimchi/contrib/Makefile.am b/src/wok/plugins/kimchi/contrib/Makefile.am
index 5001191..d1a4569 100644
--- a/src/wok/plugins/kimchi/contrib/Makefile.am
+++ b/src/wok/plugins/kimchi/contrib/Makefile.am
@@ -1,4 +1,7 @@
-# Copyright IBM Corp, 2013
+#
+# 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
@@ -18,6 +21,7 @@ SUBDIRS = DEBIAN
EXTRA_DIST = \
check_i18n.py \
+ kimchid.service.fedora \
kimchi.spec.fedora.in \
make-deb.sh.in \
$(NULL)
diff --git a/src/wok/plugins/kimchi/contrib/kimchid.service.fedora b/src/wok/plugins/kimchi/contrib/kimchid.service.fedora
new file mode 100644
index 0000000..cd8e137
--- /dev/null
+++ b/src/wok/plugins/kimchi/contrib/kimchid.service.fedora
@@ -0,0 +1,7 @@
+[Unit]
+Requires=libvirtd.service wokd.service
+After=libvirtd.service wokd.service
+
+[Service]
+Nice=0
+PrivateTmp=yes
--
2.4.3
9 years, 2 months
Re: [Kimchi-devel] Fix for the repository action issue
by Aline Manera
Please, don't forget to reply to the Kimchi ML
On 15/10/2015 09:43, Samuel Henrique De Oliveira Guimaraes wrote:
>
> Hi Atreye,
>
> Thank you! It works! I’ll rebase my patches and once Aline applies the
> new-ui in Kimchi master, I’ll be creating an issue for documentation
> purposes and you can comment that you fixed and send a patch with the
> issue number to the Mailing List, making your contribution appear in
> the commit history.
>
> Regards,
>
> Samuel
>
> *From:*Atreye Mukhopadhyay [mailto:atreyee@linux.vnet.ibm.com]
> *Sent:* quinta-feira, 15 de outubro de 2015 09:28
> *To:* Samuel Henrique De Oliveira Guimaraes
> <samuel.guimaraes(a)eldorado.org.br>
> *Cc:* Aline Manera <alinefm(a)linux.vnet.ibm.com>; Chandra Shehkhar
> Reddy Potula <chandra(a)linux.vnet.ibm.com>; Walter Niklaus
> <niklaus(a)linux.vnet.ibm.com>
> *Subject:* Fix for the repository action issue
>
> Hi Samuel,
> I have fixed the issue you mentioned during the hangout meeting
> session regarding the incorrect action name for enabled repositories
> in repository list.
> I worked on the latest code available in your branch
> https://github.com/samhenri/kimchi.git. I have made changes in
> "onRowSelected" method in kimchi.host.js. Changes are highlighted below.
>
> Enable/disable button of each row was having same 'id' . Incorrect
> action was displayed for the enabled repositories other than first
> record as $('#repositories-grid-enable-button') was always returning
> button from first action dropdown menu.
>
>
> onRowSelected: function(row) {
> var repository = repositoriesGrid.getSelected();
> if (!repository) {
> return;
> }
> *var selectedRow = $('tr', repositoriesGrid.bodyContainer);*
> $('#repositories-grid-remove-button',selectedRow).prop('disabled', false);
> $('#repositories-grid-edit-button',selectedRow).prop('disabled', false);
> var enabled = repository['enabled'];
>
> *$('#repositories-grid-enable-button',selectedRow)
> .html('<i class="fa
> fa-play-circle-o"></i>'+*i18n[enabled ? 'KCHREPO6017M' : 'KCHREPO6016M'])
> .prop('disabled', false);
> },
>
> Screenshots are attached herewith.
>
> Please ignore the mail if you have resolved the issue already .
>
> Thanks & Regards,
> Atreyee
>
9 years, 2 months
[PATCH] Fix issue #738 - Split Wok and Kimchi object stores
by Lucio Correia
Wok and Kimchi currently share the same object store. This
patch creates a specific store for Kimchi to avoid name
conflicts with Wok and other plugins in future.
It also makes objectstore location a required parameter for
model instantiation, since there is no more default location
provided by Wok. Each plugin will have its own object store
in its own location
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
Makefile.am | 5 ++++-
contrib/wok.spec.fedora.in | 3 ++-
contrib/wok.spec.suse.in | 3 ++-
src/wok/model/model.py | 2 +-
src/wok/objectstore.py | 5 ++---
src/wok/plugins/kimchi/Makefile.am | 4 ++--
src/wok/plugins/kimchi/config.py.in | 4 ++++
src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in | 2 +-
src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in | 2 +-
src/wok/plugins/kimchi/mockmodel.py | 2 +-
src/wok/plugins/kimchi/root.py | 7 +++++--
src/wok/plugins/kimchi/tests/test_yumparser.py | 3 ++-
src/wok/server.py | 2 +-
13 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 8d2f346..54bc521 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -83,6 +83,8 @@ install-deb: install
cp -R $(top_srcdir)/contrib/wokd-upstart.conf.debian \
$(DESTDIR)/etc/init/wokd.conf; \
fi
+ $(MKDIR_P) -p $(DESTDIR)/$(localstatedir)/lib/wok/
+ touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)/usr/lib/firewalld/services
cp -R $(top_srcdir)/src/firewalld.xml \
$(DESTDIR)/usr/lib/firewalld/services/wokd.xml
@@ -128,12 +130,13 @@ install-data-local:
mkdir -p $(DESTDIR)/etc/init.d/; \
$(INSTALL_DATA) contrib/wokd.sysvinit $(DESTDIR)/etc/init.d/wokd; \
chmod +x $(DESTDIR)/etc/init.d/wokd; \
- fi; \
+ 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/wokd.xml; \
fi; \
mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/
+ touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
mkdir -p $(DESTDIR)/$(localstatedir)/log/wok/
touch $(DESTDIR)/$(localstatedir)/log/wok/wok-access.log
touch $(DESTDIR)/$(localstatedir)/log/wok/wok-error.log
diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in
index 8941ff7..ad9988e 100644
--- a/contrib/wok.spec.fedora.in
+++ b/contrib/wok.spec.fedora.in
@@ -122,6 +122,7 @@ rm -rf $RPM_BUILD_ROOT
%if 0%{?with_systemd}
%{_sysconfdir}/nginx/conf.d/wok.conf
%{_sharedstatedir}/wok/
+%{_sharedstatedir}/wok/objectstore
%{_localstatedir}/log/wok/*
%{_localstatedir}/log/wok/
%{_unitdir}/wokd.service
@@ -135,7 +136,7 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
-* Fri Jun 19 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 1.6
+* Fri Jun 19 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 2.0
- Rename to wokd
- Remove kimchi specifics
diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in
index 161b996..4b5e4f3 100644
--- a/contrib/wok.spec.suse.in
+++ b/contrib/wok.spec.suse.in
@@ -95,6 +95,7 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/nginx/conf.d/wok.conf.in
%{_sysconfdir}/nginx/conf.d/wok.conf
%{_var}/lib/wok/
+%{_var}/lib/wok/objectstore
%{_localstatedir}/log/wok/*
%{_localstatedir}/log/wok/
%{_mandir}/man8/wokd.8.gz
@@ -115,7 +116,7 @@ rm -rf $RPM_BUILD_ROOT
%changelog
-* Fri Jun 19 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 1.6
+* Fri Jun 19 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 2.0
- Rename to wokd
- Remove kimchi specifics
diff --git a/src/wok/model/model.py b/src/wok/model/model.py
index e8826f2..cb213d3 100644
--- a/src/wok/model/model.py
+++ b/src/wok/model/model.py
@@ -28,7 +28,7 @@ from wok.utils import import_module, listPathModules
class Model(BaseModel):
- def __init__(self, objstore_loc=None):
+ def __init__(self, objstore_loc):
self.objstore = ObjectStore(objstore_loc)
kargs = {'objstore': self.objstore}
diff --git a/src/wok/objectstore.py b/src/wok/objectstore.py
index 670a363..810c5be 100644
--- a/src/wok/objectstore.py
+++ b/src/wok/objectstore.py
@@ -29,7 +29,6 @@ except ImportError:
from ordereddict import OrderedDict
-from wok import config
from wok.exception import NotFoundError
from wok.utils import wok_log
@@ -83,10 +82,10 @@ class ObjectStoreSession(object):
class ObjectStore(object):
- def __init__(self, location=None):
+ def __init__(self, location):
self._lock = threading.Semaphore()
self._connections = OrderedDict()
- self.location = location or config.get_object_store()
+ self.location = location
with self._lock:
self._init_db()
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 1080005..404c3f4 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -99,7 +99,7 @@ config.py: config.py.in Makefile
install-deb: install
cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi
- touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
+ touch $(DESTDIR)/$(localstatedir)/lib/kimchi/objectstore
mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/debugreports
mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/screenshots
@@ -140,7 +140,7 @@ ChangeLog:
install-data-local:
$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/kimchi/
- touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
+ touch $(DESTDIR)/$(localstatedir)/lib/kimchi/objectstore
$(MKDIR_P) $(DESTDIR)$(kimchidir)
$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
diff --git a/src/wok/plugins/kimchi/config.py.in b/src/wok/plugins/kimchi/config.py.in
index 6ae0ccd..43e94e1 100644
--- a/src/wok/plugins/kimchi/config.py.in
+++ b/src/wok/plugins/kimchi/config.py.in
@@ -42,6 +42,10 @@ def get_debugreports_path():
return os.path.join(PluginPaths('kimchi').state_dir, 'debugreports')
+def get_object_store():
+ return os.path.join(PluginPaths('kimchi').state_dir, 'objectstore')
+
+
def get_screenshot_path():
return os.path.join(PluginPaths('kimchi').state_dir, 'screenshots')
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
index e4b7b6d..41a8a86 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -100,10 +100,10 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/
%{_sharedstatedir}/kimchi/debugreports/
%{_sharedstatedir}/kimchi/isos/
+%{_sharedstatedir}/kimchi/objectstore
%{_sharedstatedir}/kimchi/screenshots/
%{_sharedstatedir}/kimchi/vnc-tokens/
%{_sharedstatedir}/kimchi/
-%{_sharedstatedir}/wok/objectstore
%changelog
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
index 03dfa7b..6fbdb3e 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -87,10 +87,10 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/
%{_var}/lib/kimchi/debugreports/
%{_var}/lib/kimchi/isos/
+%{_var}/lib/kimchi/objectstore
%{_var}/lib/kimchi/screenshots/
%{_var}/lib/kimchi/vnc-tokens/
%{_var}/lib/kimchi/
-%{_var}/lib/wok/objectstore
%changelog
diff --git a/src/wok/plugins/kimchi/mockmodel.py b/src/wok/plugins/kimchi/mockmodel.py
index 0832b20..4dd063c 100644
--- a/src/wok/plugins/kimchi/mockmodel.py
+++ b/src/wok/plugins/kimchi/mockmodel.py
@@ -67,7 +67,7 @@ class MockModel(Model):
_undefineDomain = libvirt.virDomain.undefine
_libvirt_get_vol_path = LibvirtVMTemplate._get_volume_path
- def __init__(self, objstore_loc=None):
+ def __init__(self, objstore_loc):
# Override osinfo.defaults to ajust the values according to
# test:///default driver
defaults = dict(osinfo.defaults)
diff --git a/src/wok/plugins/kimchi/root.py b/src/wok/plugins/kimchi/root.py
index 1e2bfc7..21c3131 100644
--- a/src/wok/plugins/kimchi/root.py
+++ b/src/wok/plugins/kimchi/root.py
@@ -33,12 +33,14 @@ from model import model as kimchiModel
class KimchiRoot(WokRoot):
def __init__(self, wok_options):
+ objstore_loc = config.get_object_store()
if hasattr(wok_options, "model"):
self.model = wok_options.model
elif wok_options.test:
- self.model = mockmodel.MockModel()
+ mockstore = "%s-mock" % os.path.abspath(objstore_loc)
+ self.model = mockmodel.MockModel(mockstore)
else:
- self.model = kimchiModel.Model()
+ self.model = kimchiModel.Model(objstore_loc=objstore_loc)
dev_env = wok_options.environment != 'production'
super(KimchiRoot, self).__init__(self.model, dev_env)
@@ -57,6 +59,7 @@ class KimchiRoot(WokRoot):
self.messages = messages
make_dirs = [
+ os.path.dirname(os.path.abspath(config.get_object_store())),
os.path.abspath(config.get_distros_store()),
os.path.abspath(config.get_debugreports_path()),
os.path.abspath(config.get_screenshot_path())
diff --git a/src/wok/plugins/kimchi/tests/test_yumparser.py b/src/wok/plugins/kimchi/tests/test_yumparser.py
index be5e95c..c69f574 100644
--- a/src/wok/plugins/kimchi/tests/test_yumparser.py
+++ b/src/wok/plugins/kimchi/tests/test_yumparser.py
@@ -23,6 +23,7 @@ import unittest
from wok.rollbackcontext import RollbackContext
+from wok.plugins.kimchi import config
from wok.plugins.kimchi.model import model
from wok.plugins.kimchi.yumparser import delete_repo_from_file, get_repo_files
from wok.plugins.kimchi.yumparser import get_yum_packages_list_update
@@ -34,7 +35,7 @@ TEMP_REPO_FILE = ''
def _is_yum_distro():
- inst = model.Model('test:///default')
+ inst = model.Model('test:///default', config.get_object_store())
repo_type = inst.capabilities_lookup()['repo_mngt_tool']
return repo_type == 'yum'
diff --git a/src/wok/server.py b/src/wok/server.py
index c6f12dd..071c425 100644
--- a/src/wok/server.py
+++ b/src/wok/server.py
@@ -124,7 +124,7 @@ class Server(object):
if hasattr(options, 'model'):
model_instance = options.model
else:
- model_instance = model.Model()
+ model_instance = model.Model(config.get_object_store())
for ident, node in sub_nodes.items():
if node.url_auth:
--
1.9.1
9 years, 2 months
Re: [Kimchi-devel] Fix for the repository action issue
by Aline Manera
Thanks, Atreyee!
Seems you forgot to include the Kimchi ML. I am doing it now so everyone
can be aware about that.
Please, send the patch itself direct to the ML. It is easy to apply the
changes and test.
Regards,
Aline Manera
On 15/10/2015 09:27, Atreye Mukhopadhyay wrote:
> Hi Samuel,
> I have fixed the issue you mentioned during the hangout meeting
> session regarding the incorrect action name for enabled repositories
> in repository list.
> I worked on the latest code available in your branch
> https://github.com/samhenri/kimchi.git . I have made changes in
> "onRowSelected" method in kimchi.host.js. Changes are highlighted below.
>
> Enable/disable button of each row was having same 'id' . Incorrect
> action was displayed for the enabled repositories other than first
> record as $('#repositories-grid-enable-button') was always returning
> button from first action dropdown menu.
>
>
> onRowSelected: function(row) {
> var repository = repositoriesGrid.getSelected();
> if (!repository) {
> return;
> }
> *var selectedRow = $('tr', repositoriesGrid.bodyContainer);*
> $('#repositories-grid-remove-button',selectedRow).prop('disabled', false);
> $('#repositories-grid-edit-button',selectedRow).prop('disabled', false);
> var enabled = repository['enabled'];
>
> *$('#repositories-grid-enable-button',selectedRow)**
> ** .html('<i class="fa
> fa-play-circle-o"></i>'+*i18n[enabled ? 'KCHREPO6017M' : 'KCHREPO6016M'])
> .prop('disabled', false);
> },
>
> Screenshots are attached herewith.
>
> Please ignore the mail if you have resolved the issue already .
>
> Thanks & Regards,
> Atreyee
9 years, 2 months
[PATCH] Fix opensuse OBS Build Error in the initd file
by LiHaSo
Signed-off-by: LiHaSo <rene.linder(a)lihaso.ch>
---
contrib/wokd.sysvinit | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/wokd.sysvinit b/contrib/wokd.sysvinit
index 10680ee..b44ce7c 100644
--- a/contrib/wokd.sysvinit
+++ b/contrib/wokd.sysvinit
@@ -23,7 +23,7 @@
### BEGIN INIT INFO
# Provides: wokd
# Required-Start: libvirtd
-# Required-Stop:
+# Required-Stop: libvirtd
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the wokd daemon
--
2.6.0
9 years, 2 months
[PATCH] [v3] Proxy websocket connections through nginx
by Rob Lemley
This is v3 of a patch thats sets up nginx to proxy websocket connections.
Rob Lemley (1):
Configure nginx to proxy connections to the websocket server.
configure.ac | 1 -
docs/README.md | 5 +----
src/firewalld.xml | 1 -
src/nginx/wok.conf.in | 15 +++++++++++++
src/wok/plugins/kimchi/config.py.in | 6 +++++-
src/wok/plugins/kimchi/configure.ac | 1 +
src/wok/plugins/kimchi/docs/README.md | 5 +----
src/wok/plugins/kimchi/model/config.py | 2 ++
src/wok/plugins/kimchi/ui/Makefile.am | 2 +-
src/wok/plugins/kimchi/ui/js/src/kimchi.api.js | 18 ++++++++--------
.../kimchi/ui/spice-html5/pages/spice_auto.html | 2 +-
src/wok/plugins/kimchi/ui/websockify/Makefile.am | 22 +++++++++++++++++++
src/wok/plugins/kimchi/ui/websockify/console.html | 25 ++++++++++++++++++++++
src/wok/plugins/kimchi/vnc.py | 4 ++--
src/wok/proxy.py | 1 +
src/wokd.in | 1 +
ui/pages/Makefile.am | 2 --
ui/pages/websockify/Makefile.am | 22 -------------------
ui/pages/websockify/console.html | 25 ----------------------
19 files changed, 87 insertions(+), 73 deletions(-)
create mode 100644 src/wok/plugins/kimchi/ui/websockify/Makefile.am
create mode 100644 src/wok/plugins/kimchi/ui/websockify/console.html
delete mode 100644 ui/pages/websockify/Makefile.am
delete mode 100644 ui/pages/websockify/console.html
--
1.8.3.1
9 years, 2 months
[PATCH] imageinfo.py: Don't fail template creation if unable to detect OS
by bbaude@redhat.com
From: Brent Baude <bbaude(a)redhat.com>
This patch slightly alters the behaviour when creating a template
from an exisiting disk image (i.e. qcow2). If guestfs is unable
to detect what distro, version, etc is within the image, it should
not be a catastrophic error. In fact, the vmtemplate.py handles
the return of distro == 'unknown' already by creating a
uuid for it.
This is important for operating systems like Atomic (RHEL, CentOS,
and Fedora) because they have a non-standard partition and disk
layout that guestfs cannot readily figure out.
---
src/wok/plugins/kimchi/imageinfo.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/wok/plugins/kimchi/imageinfo.py b/src/wok/plugins/kimchi/imageinfo.py
index 8a22495..75cda76 100644
--- a/src/wok/plugins/kimchi/imageinfo.py
+++ b/src/wok/plugins/kimchi/imageinfo.py
@@ -51,14 +51,15 @@ def probe_image(image_path):
g = guestfs.GuestFS(python_return_dict=True)
g.add_drive_opts(image_path, readonly=1)
g.launch()
-
try:
roots = g.inspect_os()
except:
raise ImageFormatError("KCHIMG0001E")
if len(roots) == 0:
- raise ImageFormatError("KCHIMG0002E")
+ # If we are unable to detect the OS, still add the image
+ # but make distro and vendor 'unknown'
+ return ("unknown", "unknown")
for root in roots:
version = "%d.%d" % (g.inspect_get_major_version(root),
--
2.4.3
9 years, 2 months
[PATCH] Fix package name of some dependencies
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Fedora and OpenSUSE uses the name python-devel to handle the development
libraries for Pyhton, instead of the name python-dev.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
contrib/wok.spec.fedora.in | 2 +-
contrib/wok.spec.suse.in | 2 +-
docs/README.md | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/wok.spec.fedora.in b/contrib/wok.spec.fedora.in
index 8941ff7..7987fa8 100644
--- a/contrib/wok.spec.fedora.in
+++ b/contrib/wok.spec.fedora.in
@@ -22,7 +22,7 @@ Requires: open-sans-fonts
BuildRequires: libxslt
BuildRequires: openssl
BuildRequires: python-lxml
-BuildRequires: python-dev
+BuildRequires: python-devel
BuildRequires: python-pip
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
diff --git a/contrib/wok.spec.suse.in b/contrib/wok.spec.suse.in
index 161b996..f749b9e 100644
--- a/contrib/wok.spec.suse.in
+++ b/contrib/wok.spec.suse.in
@@ -23,7 +23,7 @@ Requires: google-opensans-fonts
BuildRequires: libxslt-tools
BuildRequires: openssl
BuildRequires: python-lxml
-BuildRequires: python-dev
+BuildRequires: python-devel
BuildRequires: python-pip
%if 0%{?suse_version} == 1100
diff --git a/docs/README.md b/docs/README.md
index c6c5601..afdbace 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -53,7 +53,7 @@ Install Dependencies
python-cherrypy python-cheetah python-imaging\
PyPAM m2crypto python-jsonschema rpm-build \
python-psutil python-ldap python-lxml \
- libxslt nginx openssl python-dev python-pip
+ libxslt nginx openssl python-devel python-pip
$ sudo pip install cython libsass
@@ -98,7 +98,7 @@ channel at RHN Classic or Red Hat Satellite.
python-CherryPy python-Cheetah python-pam \
python-imaging python-M2Crypto python-jsonschema \
rpm-build python-psutil python-ldap python-lxml \
- libxslt-tools python-xml nginx openssl python-dev \
+ libxslt-tools python-xml nginx openssl python-devel \
python-pip
$ sudo pip install cython libsass
--
2.4.3
9 years, 2 months
[PATCH] Fix issue #738 - Use *lib/kimchi instead of *lib/wok/plugins/kimchi
by Lucio Correia
Part 1: Move back kimchi files to kimchi tree. Object store is a
special case that will be handled in a future patch.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/config.py.in | 2 +-
src/wok/plugins/kimchi/Makefile.am | 20 +++++++++++---------
src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in | 12 ++++++------
src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in | 12 ++++++------
src/wok/plugins/kimchi/vnc.py | 4 ++--
5 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index b33fb6b..e98d1de 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -116,7 +116,7 @@ class PluginPaths(Paths):
if self.installed:
self.plugin_dir = os.path.join('plugins', name)
- self.state_dir = os.path.join(paths.state_dir, self.plugin_dir)
+ self.state_dir = os.path.join('@localstatedir@/lib', name)
self.conf_dir = '@sysconfdir(a)/wok/plugins.d'
self.src_dir = os.path.join('@wokdir@', self.plugin_dir)
self.mo_dir = '@prefix@/share/locale'
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 34ddef4..1080005 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -98,12 +98,12 @@ config.py: config.py.in Makefile
install-deb: install
cp -R $(top_srcdir)/contrib/DEBIAN $(DESTDIR)/
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi
touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/vnc-tokens
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/debugreports
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/screenshots
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/isos
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/debugreports
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/screenshots
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/isos
deb: contrib/make-deb.sh
@@ -139,16 +139,18 @@ ChangeLog:
fi
install-data-local:
- $(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/wok/
+ $(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/kimchi/
touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)$(kimchidir)
$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/vnc-tokens
- mkdir -p $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/{debugreports,isos,screenshots}
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/vnc-tokens
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/debugreports
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/screenshots
+ mkdir -p $(DESTDIR)/$(localstatedir)/lib/kimchi/isos
uninstall-local:
$(RM) $(DESTDIR)$(kimchidir)/API.json
- $(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi
+ $(RM) -rf $(DESTDIR)/$(localstatedir)/lib/kimchi
VERSION:
@if test -d .git; then \
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
index f56d235..e4b7b6d 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.fedora.in
@@ -98,16 +98,16 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
%{_sysconfdir}/kimchi/
-%{_sharedstatedir}/wok/plugins/kimchi/debugreports/
-%{_sharedstatedir}/wok/plugins/kimchi/isos/
-%{_sharedstatedir}/wok/plugins/kimchi/screenshots/
-%{_sharedstatedir}/wok/plugins/kimchi/vnc-tokens/
-%{_sharedstatedir}/wok/plugins/kimchi/
+%{_sharedstatedir}/kimchi/debugreports/
+%{_sharedstatedir}/kimchi/isos/
+%{_sharedstatedir}/kimchi/screenshots/
+%{_sharedstatedir}/kimchi/vnc-tokens/
+%{_sharedstatedir}/kimchi/
%{_sharedstatedir}/wok/objectstore
%changelog
-* Thu Jun 18 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 1.6
+* Thu Jun 18 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 2.0
- Run kimchi as a plugin
* Thu Feb 26 2015 Frédéric Bonnard <frediz(a)linux.vnet.ibm.com> 1.4.0
diff --git a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
index 64b9025..03dfa7b 100644
--- a/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
+++ b/src/wok/plugins/kimchi/contrib/kimchi.spec.suse.in
@@ -85,16 +85,16 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/kimchi/distros.d/ubuntu.json
%{_sysconfdir}/kimchi/distros.d/gentoo.json
%{_sysconfdir}/kimchi/
-%{_var}/lib/wok/plugins/kimchi/debugreports/
-%{_var}/lib/wok/plugins/kimchi/isos/
-%{_var}/lib/wok/plugins/kimchi/screenshots/
-%{_var}/lib/wok/plugins/kimchi/vnc-tokens/
-%{_var}/lib/wok/plugins/kimchi/
+%{_var}/lib/kimchi/debugreports/
+%{_var}/lib/kimchi/isos/
+%{_var}/lib/kimchi/screenshots/
+%{_var}/lib/kimchi/vnc-tokens/
+%{_var}/lib/kimchi/
%{_var}/lib/wok/objectstore
%changelog
-* Thu Jun 18 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 1.6
+* Thu Jun 18 2015 Lucio Correia <luciojhc(a)linux.vnet.ibm.com> 2.0
- Run kimchi as a plugin
* Thu Feb 26 2015 Frédéric Bonnard <frediz(a)linux.vnet.ibm.com> 1.4.0
diff --git a/src/wok/plugins/kimchi/vnc.py b/src/wok/plugins/kimchi/vnc.py
index 2532449..1a2e59d 100644
--- a/src/wok/plugins/kimchi/vnc.py
+++ b/src/wok/plugins/kimchi/vnc.py
@@ -24,10 +24,10 @@ import os
from multiprocessing import Process
from websockify import WebSocketProxy
-from wok.config import config, paths
+from wok.config import config, paths, PluginPaths
-WS_TOKENS_DIR = '/var/lib/wok/vnc-tokens'
+WS_TOKENS_DIR = os.path.join(PluginPaths('kimchi').state_dir, 'vnc-tokens')
def new_ws_proxy():
--
1.9.1
9 years, 2 months