[PATCH V6 0/2] Add the front end support for iSCSI storage pool.
by zhoumeina
v5-v6 change some tranlate strings.
drop "..." in iSCSI storage pool add page.
v4-v5 change tabs to 4 spaces.
modify the post iSCSI data type to make it fit for back-end.
change chinese translations target to "目标"
v3-v4 send para when auth is enable
v2-v3 Modify this patchset according to backend changes
Include create storage pool UI and translation files.
zhoumeina (2):
Add UI support of iscsi
Add the ISCSI translation po files
po/en_US.po | 52 +++++++++++++++++----
po/kimchi.pot | 47 +++++++++++++++---
po/pt_BR.po | 48 ++++++++++++++++---
po/zh_CN.po | 48 ++++++++++++++++---
ui/css/theme-default/form.css | 5 ++
ui/js/src/kimchi.storagepool_add_main.js | 76 +++++++++++++++++++++++++----
ui/js/src/kimchi.utils.js | 5 ++
ui/pages/i18n.html.tmpl | 7 ++-
ui/pages/storagepool-add.html.tmpl | 48 +++++++++++++++----
9 files changed, 280 insertions(+), 56 deletions(-)
mode change 100644 => 100755 po/kimchi.pot
10 years, 10 months
[PATCH v4 1/4] Move configuration parsing to config.py
by Mark Wu
The configuration is also needed for other code except starting kimchi
server. So it should be moved to a separate module, config.py. Then the
configuration can be accessed directly by importing config module.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
src/kimchi/config.py.in | 25 +++++++++++++++++++++++++
src/kimchid.in | 20 +-------------------
2 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index f3c408a..a3973ce 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -27,11 +27,14 @@ import os
import platform
+from ConfigParser import SafeConfigParser
from glob import iglob
from kimchi.xmlutils import xpath_get_text
+DEFAULT_LOG_LEVEL = "debug"
+
def get_prefix():
if __file__[0] == '/':
@@ -166,5 +169,27 @@ def get_plugin_tab_xml(name):
return os.path.join(_get_plugin_ui_dir(name), 'config/tab-ext.xml')
+def _get_config():
+ config = SafeConfigParser()
+ config.add_section("server")
+ config.set("server", "host", "0.0.0.0")
+ config.set("server", "port", "8000")
+ config.set("server", "ssl_port", "8001")
+ config.set("server", "ssl_cert", "")
+ config.set("server", "ssl_key", "")
+ config.set("server", "environment", "development")
+ config.add_section("logging")
+ config.set("logging", "log_dir", get_default_log_dir())
+ config.set("logging", "log_level", DEFAULT_LOG_LEVEL)
+
+ config_file = os.path.join(get_config_dir(), 'kimchi.conf')
+ if os.path.exists(config_file):
+ config.read(config_file)
+ return config
+
+
+config = _get_config()
+
+
if __name__ == '__main__':
print get_prefix()
diff --git a/src/kimchid.in b/src/kimchid.in
index 7865713..548fa52 100644
--- a/src/kimchid.in
+++ b/src/kimchid.in
@@ -33,31 +33,13 @@ import kimchi.config
if kimchi.config.without_installation():
sys.path.append(kimchi.config.get_prefix())
-from ConfigParser import SafeConfigParser
+from kimchi.config import config
from optparse import OptionParser
ACCESS_LOG = "kimchi-access.log"
ERROR_LOG = "kimchi-error.log"
-CONFIG_FILE = "%s/kimchi.conf" % kimchi.config.get_config_dir()
-DEFAULT_LOG_DIR = kimchi.config.get_default_log_dir()
-DEFAULT_LOG_LEVEL = "debug"
def main(options):
- config = SafeConfigParser()
- config.add_section("server")
- config.set("server", "host", "0.0.0.0")
- config.set("server", "port", "8000")
- config.set("server", "ssl_port", "8001")
- config.set("server", "ssl_cert", "")
- config.set("server", "ssl_key", "")
- config.set("server", "environment", "development")
- config.add_section("logging")
- config.set("logging", "log_dir", DEFAULT_LOG_DIR)
- config.set("logging", "log_level", DEFAULT_LOG_LEVEL)
-
- if os.path.exists(CONFIG_FILE):
- config.read(CONFIG_FILE)
-
host = config.get("server", "host")
port = config.get("server", "port")
ssl_port = config.get("server", "ssl_port")
--
1.8.4.2
10 years, 10 months
[PATCH v3 1/3] Generate libvirt's interface XML definition for vlan tagged bridge
by Mark Wu
To support vlan tagged virtual network, kimchi needs create the underlying
vlan and bridge interface. Libvirt's interface driver can do it with
a given XML definition. This patch targets to generate the XML according
to the interface and vlan id.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
src/kimchi/networkxml.py | 19 +++++++++++++++++++
tests/test_networkxml.py | 22 ++++++++++++++++++++++
tests/utils.py | 6 ++++++
3 files changed, 47 insertions(+)
diff --git a/src/kimchi/networkxml.py b/src/kimchi/networkxml.py
index 786cb69..63cb210 100644
--- a/src/kimchi/networkxml.py
+++ b/src/kimchi/networkxml.py
@@ -21,6 +21,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import ipaddr
+import lxml.etree as ET
+
+
+from lxml.builder import E
# FIXME, do not support ipv6
@@ -109,3 +113,18 @@ def to_network_xml(**kwargs):
</network>
""" % params
return xml
+
+
+def create_vlan_tagged_bridge_xml(bridge, interface, vlan_id):
+ vlan = E.vlan(E.interface(name=interface))
+ vlan.set('tag', vlan_id)
+ m = E.interface(
+ E.start(mode='onboot'),
+ E.bridge(
+ E.interface(
+ vlan,
+ type='vlan',
+ name='.'.join([interface, vlan_id]))),
+ type='bridge',
+ name=bridge)
+ return ET.tostring(m)
diff --git a/tests/test_networkxml.py b/tests/test_networkxml.py
index 3073bce..42b3ea9 100644
--- a/tests/test_networkxml.py
+++ b/tests/test_networkxml.py
@@ -25,6 +25,9 @@ import unittest
import kimchi.networkxml as nxml
+import utils
+
+
from kimchi.xmlutils import xpath_get_text
@@ -151,3 +154,22 @@ class NetworkXmlTests(unittest.TestCase):
netmask = xpath_get_text(xml, "/network/ip/@netmask")[0]
self.assertEquals(netmask,
str(ipaddr.IPNetwork(params["net"]).netmask))
+
+
+class InterfaceXmlTests(unittest.TestCase):
+
+ def test_vlan_tagged_bridge_no_ip(self):
+ expected_xml = """
+ <interface type='bridge' name='br10'>
+ <start mode='onboot'/>
+ <bridge>
+ <interface type='vlan' name='em1.10'>
+ <vlan tag='10'>
+ <interface name='em1'/>
+ </vlan>
+ </interface>
+ </bridge>
+ </interface>
+ """
+ actual_xml = nxml.create_vlan_tagged_bridge_xml('br10', 'em1', '10')
+ self.assertEquals(actual_xml, utils.normalize_xml(expected_xml))
diff --git a/tests/utils.py b/tests/utils.py
index 008f668..79fc2e2 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -32,6 +32,7 @@ import unittest
from contextlib import closing
+from lxml import etree
import kimchi.server
@@ -159,3 +160,8 @@ def patch_auth():
import kimchi.auth
kimchi.auth.authenticate = _authenticate
+
+
+def normalize_xml(xml_str):
+ return etree.tostring(etree.fromstring(xml_str,
+ etree.XMLParser(remove_blank_text=True)))
--
1.8.4.2
10 years, 10 months
[PATCH V8 0/1] Open 8000 and 8001 port by default for distro packages
by taget@linux.vnet.ibm.com
From: Eli Qiao <taget(a)linux.vnet.ibm.com>
V8 -V7 changes:
1. Rebase to latest code.(DEBIAN/control.in)
2. Install kimchid.xml to system dir (shu ming)
3. Remove changes for open suse.(Aline)
V7 -V6 changes:
1. Remove firewalld message when install kimchi rpm on fedora/RHEL
2. Start firewalld service if not start
3. Ship kimchid.xml to ubuntu distro in Makefile.am
V6 -V5 changes:
1.Keep specific condition for RHEL6 when starting kimchid service
2.Remove full path of firewall-cmd in postrm
V5 - V4 changes:
1. Add cover-letter. (Aline)
2. Move clean up rules into if condition. (Aline)
3. Use with_systemd condition to check if use firewalld rules. (Aline)
4. Fix typo (Aline)
V4 - V3 changes:
1 Fix typo in firewalld.xml (Rodrigo)
V3 - V2 changes:
1.Rename kimchid.xml to firewalld.xml (Mark)
2.Remove firewalld from serivce require (Mark)
3.Fix typo
V2 - V1 changes:
1.Add firewalld sevice configure file kimchid.xml to help open iptables port (Mark)
2.Add Ubuntu iptables rule (Royce)
Eli Qiao (1):
spec: Open 8000 and 8001 port by default
Makefile.am | 2 ++
contrib/DEBIAN/control.in | 1 +
contrib/DEBIAN/postinst | 6 ++++++
contrib/DEBIAN/postrm | 2 ++
contrib/kimchi.spec.fedora.in | 26 ++++++++++++++++++++++++++
src/Makefile.am | 1 +
src/firewalld.xml | 7 +++++++
7 files changed, 45 insertions(+)
create mode 100644 src/firewalld.xml
--
1.8.3.1
10 years, 10 months
[RFC] VMS filter
by Sheldon
We have discuss this before.
We will support several API to support vms filter.
such as:
/vms?network='net1'
/vms?status='running'
anymore?
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center
10 years, 10 months
[PATCHv5 0/8] Storage server and targets support
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v4>v5, remove storage server list reload function,
merge storage server and targets
v3>v4, fix inconsistency between doc and json schema
v1>v3, fix racing problem, fix style.
Add parameters to GET request so that we will query storage server as:
/storageservers?target_type=netfs
Query all servers of any type supported(now only netfs):
/storageservers
Query all storage targets on a server:
/storageservers/host-name/storagetargets
Query a given type of storage targets:
/storageservers/host-name/storagetargets?target_type=netfs
Royce Lv (8):
Support params for GET method
Add testcase for GET param
Storage server: Update API.md
storage server: update controller.py
storage server: Update model and mockmodel
storage target: Update API.md
storage target: Update controller and json schema
storage target: Add model support
docs/API.md | 22 +++++++++++
src/kimchi/API.json | 20 ++++++++++
src/kimchi/control/base.py | 8 ++--
src/kimchi/control/storageserver.py | 63 +++++++++++++++++++++++++++++++
src/kimchi/control/utils.py | 2 +
src/kimchi/mockmodel.py | 28 ++++++++++++++
src/kimchi/model.py | 74 +++++++++++++++++++++++++++++++++++++
src/kimchi/root.py | 2 +
tests/test_rest.py | 37 +++++++++++++++++++
9 files changed, 253 insertions(+), 3 deletions(-)
create mode 100644 src/kimchi/control/storageserver.py
--
1.8.1.2
10 years, 10 months
[PATCH V4 0/3] network improvment: add vms field
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V3 -> V4
the subject of patch V3 3/3 is wrong.
fix it.
V2 -> V3
update mockmodel and test case
V1 -> V2
set the flags argument of listAllDomains as 0 explicitly.
For in some distros:
$ pydoc libvirt.virConnect.listAllDomains
libvirt.virConnect.listAllDomains = listAllDomains(self, flags) \
unbound libvirt.virConnect method
And in other distros:
$ pydoc libvirt.virConnect.listAllDomains
libvirt.virConnect.listAllDomains = listAllDomains(self, flags=0) \
unbound libvirt.virConnect method
ShaoHe Feng (3):
network improvment: add vms field
network improvment: update mockmodel to support vms field
network improvment: update test case to support vms field
docs/API.md | 1 +
src/kimchi/control/networks.py | 1 +
src/kimchi/mockmodel.py | 9 +++++++++
src/kimchi/model.py | 15 +++++++++++++++
tests/test_model.py | 1 +
tests/test_rest.py | 3 +++
6 files changed, 30 insertions(+)
--
1.8.4.2
10 years, 10 months
[PATCH V5 0/2] Add the front end support for iSCSI storage pool.
by zhoumeina
v4-v5 change tabs to 4 spaces.
modify the post iSCSI data type to make it fit for back-end.
change chinese translations target to "目标"
v3-v4 send para when auth is enable
v2-v3 Modify this patchset according to backend changes
Include create storage pool UI and translation files.
zhoumeina (2):
Add UI support of iscsi
Add the ISCSI translation po files
po/en_US.po | 52 +++++++++++++++++----
po/kimchi.pot | 47 +++++++++++++++---
po/pt_BR.po | 48 ++++++++++++++++---
po/zh_CN.po | 48 ++++++++++++++++---
ui/css/theme-default/form.css | 5 ++
ui/js/src/kimchi.storagepool_add_main.js | 76 +++++++++++++++++++++++++----
ui/js/src/kimchi.utils.js | 5 ++
ui/pages/i18n.html.tmpl | 7 ++-
ui/pages/storagepool-add.html.tmpl | 48 +++++++++++++++----
9 files changed, 280 insertions(+), 56 deletions(-)
mode change 100644 => 100755 po/kimchi.pot
10 years, 10 months
[PATCH V7 0/1] Open 8000 and 8001 port by default for distro packages
by taget@linux.vnet.ibm.com
From: Eli Qiao <taget(a)linux.vnet.ibm.com>
V7 -V6 changes:
1. Remove firewalld message when install kimchi rpm on fedora/RHEL
2. Start firewalld service if not start
3. Ship kimchid.xml to ubuntu distro in Makefile.am
V6 -V5 changes:
1.Keep specific condition for RHEL6 when starting kimchid service
2.Remove full path of firewall-cmd in postrm
V5 - V4 changes:
1. Add cover-letter. (Aline)
2. Move clean up rules into if condition. (Aline)
3. Use with_systemd condition to check if use firewalld rules. (Aline)
4. Fix typo (Aline)
V4 - V3 changes:
1 Fix typo in firewalld.xml (Rodrigo)
V3 - V2 changes:
1.Rename kimchid.xml to firewalld.xml (Mark)
2.Remove firewalld from serivce require (Mark)
3.Fix typo
V2 - V1 changes:
1.Add firewalld sevice configure file kimchid.xml to help open iptables port (Mark)
2.Add Ubuntu iptables rule (Royce)
Eli Qiao (1):
spec: Open 8000 and 8001 port by default
Makefile.am | 3 +++
contrib/DEBIAN/control.in | 3 ++-
contrib/DEBIAN/postinst | 6 ++++++
contrib/DEBIAN/postrm | 2 ++
contrib/kimchi.spec.fedora.in | 26 ++++++++++++++++++++++++++
contrib/kimchi.spec.suse.in | 10 ++++++++--
src/Makefile.am | 1 +
src/firewalld.xml | 7 +++++++
8 files changed, 55 insertions(+), 3 deletions(-)
create mode 100644 src/firewalld.xml
--
1.8.3.1
10 years, 10 months
[PATCH V5] check and set search permission for a directory
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V4 -> V5
check the group permission.
V3 -> V4
rebase
add src/kimchi/utils.py to PEP8 list
ShaoHe Feng (1):
add a method to fix search permissions
Makefile.am | 1 +
src/kimchi/utils.py | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 125 insertions(+), 1 deletion(-)
--
1.8.4.2
10 years, 10 months