[PATCH] Build kimchi package in Fedora and SuSE as noarch
by Ramon Medeiros
Add the statement on spec file to build the packages as noarch.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 1 +
contrib/kimchi.spec.suse.in | 1 +
2 files changed, 2 insertions(+)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 92d3e49..37fd425 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -3,6 +3,7 @@ Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}
Summary: Kimchi server application
BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
+BuildArch: noarch
Group: System Environment/Base
License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 708acc9..3a5a370 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -3,6 +3,7 @@ Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}
Summary: Kimchi server application
BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
+BuildArch: noarch
Group: System Environment/Base
License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
--
1.8.3.1
9 years, 11 months
[PATCH] UI: Adding new widget of list
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/list-flat.css | 83 ++++++++++++++++++++++++++++++++++++++
ui/js/widgets/list-flat.js | 76 ++++++++++++++++++++++++++++++++++
2 files changed, 159 insertions(+)
create mode 100644 ui/css/theme-default/list-flat.css
create mode 100644 ui/js/widgets/list-flat.js
diff --git a/ui/css/theme-default/list-flat.css b/ui/css/theme-default/list-flat.css
new file mode 100644
index 0000000..ba0439d
--- /dev/null
+++ b/ui/css/theme-default/list-flat.css
@@ -0,0 +1,83 @@
+/*
+ * Project Kimchi
+ *
+ * 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.
+ * 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.
+ */
+
+.list-titlef {
+ height: 30px;
+ line-height: 30px;
+ width: 25%;
+ border-bottom: 1px solid #DEDEDE;
+ color: #626262;
+ font-size: 17px;
+ padding: 10px 0;
+ background: white;
+}
+
+.list-content {
+ height: 300px;
+ width: 25%;
+}
+
+.list-item {
+ border-bottom: 1px solid #F5F5F5;
+ height: 40px;
+}
+
+.list-item-odd {
+ background: #FFFFFF;
+}
+
+.list-item-even {
+ background: #FCFCFC;
+}
+
+.list-item:hover {
+ background: #DDDDDD;
+}
+
+.list-inline {
+ display: inline-block;
+}
+
+.list-item-icon {
+ line-height: 20px;
+ vertical-align: 35%;
+}
+
+.list-item-info {
+ position: relative;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+.list-item-name {
+ font-size: 14px;
+ line-height: 14px;
+ padding: 9px 0 0;
+}
+
+.list-item-button {
+ position: relative;
+ width: 150px;
+ padding: 5px;
+ float: right;
+}
+
+.list-item-detail {
+ font-size: 11px;
+ color: #CDCDCD;
+}
\ No newline at end of file
diff --git a/ui/js/widgets/list-flat.js b/ui/js/widgets/list-flat.js
new file mode 100644
index 0000000..f76eec6
--- /dev/null
+++ b/ui/js/widgets/list-flat.js
@@ -0,0 +1,76 @@
+/*
+ * Project Kimchi
+ *
+ * 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.
+ * 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.
+ */
+
+ // How to use:
+ // $(".test-bar").listFlat({
+ // title: "Hello World" //Set title.
+ // });
+ // $(".test-bar").listFlat("addItem", "Hello", "2015", "icon-user", "button1");
+ // //Add one item of the list, parameters are: name, info, icon and button-id
+
+
+ (function($) {
+
+ $.widget("kimchi.listFlat", {
+
+ options: {
+ title: null
+ },
+
+ _create: function() {
+ var that = this;
+ var listTitle = that.options.title;
+ var titleTrim = listTitle.replace(/\s*/g, "");
+ var html = "";
+ html += "<div class='list-titlef'>" + listTitle + "</div>" +
+ "<div class='list-content' id='list" + titleTrim + "'></div>";
+ $(html).appendTo(that.element);
+ },
+
+ _getTitle: function() {
+ return this.options.title;
+ },
+
+ addItem: function(name, detail, icon, id) {
+ var title = this._getTitle().replace(/\s/g, "");
+ var usedIcon = icon || "";
+ var html = "";
+ html += "<div class='list-item'>" +
+ "<span class='list-inline list-item-icon " + usedIcon + "'></span>" +
+ "<span class='list-inline list-item-info'>"+
+ "<div class='list-item-name'>" + name + "</div>" +
+ "<div class='list-item-detail'>" + detail + "</div>" +
+ "</span>" +
+ "<span class='list-inline list-item-button' id='" + id + "'></span>" +
+ "</div>";
+ $(html).appendTo($("#list" + title));
+ $.each($(".list-item"), function(index, data) {
+ if(index%2 >0) {
+ $(this).addClass("list-item-even");
+ } else {
+ $(this).addClass("list-item-odd");
+ }
+ })
+ console.log("title");
+ },
+
+ _destory: function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 11 months
[PATCH] tests/iso_gen.py: adding fake bootable PowerPC ISO
by Daniel Henrique Barboza
There was no support for ppc fake ISOs in iso_gen.py, which led
to several tests crashing in Power systems when the test tries
to create a template with a fake Intel ISO.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
tests/iso_gen.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 2 deletions(-)
diff --git a/tests/iso_gen.py b/tests/iso_gen.py
index 34f091d..1d1262f 100644
--- a/tests/iso_gen.py
+++ b/tests/iso_gen.py
@@ -17,6 +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
+import platform
import struct
from kimchi.isoinfo import IsoImage
@@ -57,9 +58,12 @@ iso_des = [
class FakeIsoImage(object):
def _build_iso(self, fd, iso_volid, bootable):
- self._build_el_boot(fd, bootable)
self._build_prim_vol(fd, iso_volid)
- self._build_el_torito(fd)
+ if platform.machine().startswith('ppc'):
+ self._build_bootable_ppc_path_table(fd)
+ else:
+ self._build_el_boot(fd, bootable)
+ self._build_el_torito(fd)
def _build_prim_vol(self, fd, iso_volid):
fd.seek(16 * IsoImage.SECTOR_SIZE)
@@ -125,6 +129,47 @@ class FakeIsoImage(object):
s = 'a' * IsoImage.SECTOR_SIZE
fd.write(s)
+ def _build_bootable_ppc_path_table(self, fd):
+ # write path table locator
+ PATH_TABLE_LOC_OFFSET = 16 * IsoImage.SECTOR_SIZE + 132
+ PATH_TABLE_SIZE_LOC = struct.Struct("<I 4s I")
+ path_table_size = 64
+ path_table_loc = 18
+ fd.seek(PATH_TABLE_LOC_OFFSET)
+ fmt = PATH_TABLE_SIZE_LOC
+ data = (path_table_size, 4*'0', path_table_loc)
+ s = fmt.pack(*data)
+ fd.write(s)
+ # write path table entry
+ fd.seek(path_table_loc * IsoImage.SECTOR_SIZE)
+ DIR_NAMELEN_LOCATION_PARENT = struct.Struct("<B B I H 3s")
+ dir_struct_size = DIR_NAMELEN_LOCATION_PARENT.size
+ dir_namelen = 3
+ dir_loc = 19
+ dir_parent = 1
+ dir_name = 'ppc'
+ data = (dir_namelen, 0, dir_loc, dir_parent, dir_name)
+ fmt = DIR_NAMELEN_LOCATION_PARENT
+ s = fmt.pack(*data)
+ fd.write(s)
+ # write 'ppc' dir record
+ ppc_dir_offset = dir_loc * IsoImage.SECTOR_SIZE
+ fd.seek(ppc_dir_offset)
+ STATIC_DIR_RECORD_FMT = struct.Struct("<B 9s I 11s B 6s B 12s")
+ dir_rec_len = 1
+ unused1 = 9 * '0'
+ dir_size = 100
+ unused2 = 11 * '0'
+ file_flags = 0
+ unused3 = 6 * '0'
+ file_name_len = 12
+ boot_file_name = "bootinfo.txt"
+ data = (dir_rec_len, unused1, dir_size, unused2, file_flags,
+ unused3, file_name_len, boot_file_name)
+ fmt = STATIC_DIR_RECORD_FMT
+ s = fmt.pack(*data)
+ fd.write(s)
+
def construct_fake_iso(path, bootable, version, distro):
iso = FakeIsoImage()
--
1.9.3
9 years, 11 months
[PATCH] On Ubuntu, current libvirt library requires <os><type arch='' specification to avoid a failure in virDomainDefineXML() and messages like - libvirtError: internal error: no supported architecture for os type 'hvm' on x86_64 arch - libvirtError: XML error: No PCI buses available on ppc64el arch
by thierry@linux.vnet.ibm.com
From: Thierry Fauck <thierry(a)linux.vnet.ibm.com>
Signed-off-by: Thierry Fauck <thierry(a)linux.vnet.ibm.com>
modified: src/kimchi/kvmusertests.py
modified: src/kimchi/model/featuretests.py
---
src/kimchi/kvmusertests.py | 14 +++++++++-----
src/kimchi/model/featuretests.py | 14 ++++++++++----
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/kimchi/kvmusertests.py b/src/kimchi/kvmusertests.py
index 2326727..be858f5 100644
--- a/src/kimchi/kvmusertests.py
+++ b/src/kimchi/kvmusertests.py
@@ -18,22 +18,23 @@
import psutil
import uuid
-
+import platform
import libvirt
from kimchi.rollbackcontext import RollbackContext
+from kimchi.utils import kimchi_log
class UserTests(object):
SIMPLE_VM_XML = """
<domain type='kvm'>
- <name>%s</name>
- <uuid>%s</uuid>
+ <name>%(vm_name)s</name>
+ <uuid>%(vm_uuid)s</uuid>
<memory unit='KiB'>262144</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
</os>
</domain>"""
@@ -46,8 +47,11 @@ class UserTests(object):
vm_uuid = uuid.uuid1()
vm_name = "kimchi_test_%s" % vm_uuid
+ arch='ppc64' if platform.machine() == 'ppc64le' else platform.machine()
- xml = cls.SIMPLE_VM_XML % (vm_name, vm_uuid)
+ xml = cls.SIMPLE_VM_XML % {'vm_name':vm_name, 'vm_uuid':vm_uuid, 'arch': arch }
+ kimchi_log.warning("DEBUG XML %s",xml)
+
with RollbackContext() as rollback:
conn = libvirt.open(None)
rollback.prependDefer(conn.close)
diff --git a/src/kimchi/model/featuretests.py b/src/kimchi/model/featuretests.py
index c187f86..7798142 100644
--- a/src/kimchi/model/featuretests.py
+++ b/src/kimchi/model/featuretests.py
@@ -23,6 +23,7 @@ import lxml.etree as ET
import socket
import subprocess
import threading
+import platform
from lxml.builder import E
@@ -37,7 +38,7 @@ ISO_STREAM_XML = """
<name>ISO_STREAMING</name>
<memory unit='KiB'>1048576</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='cdrom'/>
</os>
<devices>
@@ -59,7 +60,7 @@ SIMPLE_VM_XML = """
<name>A_SIMPLE_VM</name>
<memory unit='KiB'>10240</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
</os>
</domain>"""
@@ -102,7 +103,9 @@ class FeatureTests(object):
@staticmethod
def libvirt_supports_iso_stream(conn, protocol):
domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
- xml = ISO_STREAM_XML % {'domain': domain_type, 'protocol': protocol}
+ arch='ppc64' if platform.machine() == 'ppc64le' else platform.machine()
+ xml = ISO_STREAM_XML % {'domain': domain_type, 'protocol': protocol ,
+ 'arch': arch }
try:
FeatureTests.disable_libvirt_error_logging()
dom = conn.defineXML(xml)
@@ -190,7 +193,10 @@ class FeatureTests(object):
FeatureTests.disable_libvirt_error_logging()
rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
- dom = conn.defineXML(SIMPLE_VM_XML % {'domain': domain_type})
+ arch='ppc64' if platform.machine() == 'ppc64le' \
+ else platform.machine()
+ dom = conn.defineXML(SIMPLE_VM_XML % {'domain': domain_type ,
+ 'arch': arch})
rollback.prependDefer(dom.undefine)
try:
dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT,
--
2.1.0
9 years, 11 months
[PATCH] On Ubuntu, current libvirt library requires <os><type arch= On Ubuntu, current libvirt library requires <os><type arch= specification to avoid a failure in virDomainDefineXML() and messages like - libvirtError: internal error: no supported architecture for os type 'hvm' on x86_64 arch - libvirtError: XML error: No PCI buses available on ppc64el arch
by thierry@linux.vnet.ibm.com
From: Thierry Fauck <thierry(a)linux.vnet.ibm.com>
Signed-off-by: Thierry Fauck <thierry(a)linux.vnet.ibm.com>
modified: src/kimchi/kvmusertests.py
modified: src/kimchi/model/featuretests.py
---
src/kimchi/kvmusertests.py | 14 +++++++++-----
src/kimchi/model/featuretests.py | 14 ++++++++++----
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/kimchi/kvmusertests.py b/src/kimchi/kvmusertests.py
index 2326727..be858f5 100644
--- a/src/kimchi/kvmusertests.py
+++ b/src/kimchi/kvmusertests.py
@@ -18,22 +18,23 @@
import psutil
import uuid
-
+import platform
import libvirt
from kimchi.rollbackcontext import RollbackContext
+from kimchi.utils import kimchi_log
class UserTests(object):
SIMPLE_VM_XML = """
<domain type='kvm'>
- <name>%s</name>
- <uuid>%s</uuid>
+ <name>%(vm_name)s</name>
+ <uuid>%(vm_uuid)s</uuid>
<memory unit='KiB'>262144</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
</os>
</domain>"""
@@ -46,8 +47,11 @@ class UserTests(object):
vm_uuid = uuid.uuid1()
vm_name = "kimchi_test_%s" % vm_uuid
+ arch='ppc64' if platform.machine() == 'ppc64le' else platform.machine()
- xml = cls.SIMPLE_VM_XML % (vm_name, vm_uuid)
+ xml = cls.SIMPLE_VM_XML % {'vm_name':vm_name, 'vm_uuid':vm_uuid, 'arch': arch }
+ kimchi_log.warning("DEBUG XML %s",xml)
+
with RollbackContext() as rollback:
conn = libvirt.open(None)
rollback.prependDefer(conn.close)
diff --git a/src/kimchi/model/featuretests.py b/src/kimchi/model/featuretests.py
index c187f86..7798142 100644
--- a/src/kimchi/model/featuretests.py
+++ b/src/kimchi/model/featuretests.py
@@ -23,6 +23,7 @@ import lxml.etree as ET
import socket
import subprocess
import threading
+import platform
from lxml.builder import E
@@ -37,7 +38,7 @@ ISO_STREAM_XML = """
<name>ISO_STREAMING</name>
<memory unit='KiB'>1048576</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='cdrom'/>
</os>
<devices>
@@ -59,7 +60,7 @@ SIMPLE_VM_XML = """
<name>A_SIMPLE_VM</name>
<memory unit='KiB'>10240</memory>
<os>
- <type>hvm</type>
+ <type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
</os>
</domain>"""
@@ -102,7 +103,9 @@ class FeatureTests(object):
@staticmethod
def libvirt_supports_iso_stream(conn, protocol):
domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
- xml = ISO_STREAM_XML % {'domain': domain_type, 'protocol': protocol}
+ arch='ppc64' if platform.machine() == 'ppc64le' else platform.machine()
+ xml = ISO_STREAM_XML % {'domain': domain_type, 'protocol': protocol ,
+ 'arch': arch }
try:
FeatureTests.disable_libvirt_error_logging()
dom = conn.defineXML(xml)
@@ -190,7 +193,10 @@ class FeatureTests(object):
FeatureTests.disable_libvirt_error_logging()
rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
domain_type = 'test' if conn.getType().lower() == 'test' else 'kvm'
- dom = conn.defineXML(SIMPLE_VM_XML % {'domain': domain_type})
+ arch='ppc64' if platform.machine() == 'ppc64le' \
+ else platform.machine()
+ dom = conn.defineXML(SIMPLE_VM_XML % {'domain': domain_type ,
+ 'arch': arch})
rollback.prependDefer(dom.undefine)
try:
dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT,
--
2.1.0
9 years, 11 months
[PATCH] UI: Adding new widget of menu to kimchi new UI
by Wen Wang
From: Wen Wang <wenwang(a)linux.vnet.ibm.com>
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/menu-flat.css | 78 +++++++++++++++++++++++++
ui/js/widgets/menu-flat.js | 117 +++++++++++++++++++++++++++++++++++++
2 files changed, 195 insertions(+)
create mode 100644 ui/css/theme-default/menu-flat.css
create mode 100644 ui/js/widgets/menu-flat.js
diff --git a/ui/css/theme-default/menu-flat.css b/ui/css/theme-default/menu-flat.css
new file mode 100644
index 0000000..56a1485
--- /dev/null
+++ b/ui/css/theme-default/menu-flat.css
@@ -0,0 +1,78 @@
+/*
+ * Project Kimchi
+ *
+ * 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.
+ * 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.
+ */
+
+.menu-box {
+ width: 100%;
+ height: 30px;
+ border-radius: 3px 3px 0 3px;
+ cursor: pointer;
+ vertical-align: middle;
+ background: #4E4D4F;
+ color: #EDEDED;
+ float: right;
+}
+
+.menu-label {
+ position: relative;
+}
+
+.menu-icon-front,
+.list-icon-front {
+ position: relative;
+ font-size: 17px;
+ line-height: 32px;
+ padding-right: 10px;
+ padding-left: 5px;
+ color: #EDEDED;
+}
+
+.menu-icon {
+ position: relative;
+ float: right;
+ line-height: 30px;
+ padding-right: 10px;
+ padding-left: 10px;
+ color: #CFCFCF;
+ font-size: 10px;
+ border-top-right-radius: 3px;
+}
+
+.menu-container {
+ border: 1px solid #999999;
+ width: 100px;
+}
+
+.menu-list {
+ float: right;
+ min-width: 100%;
+ padding-left: 0;
+ margin-top: 0;
+ cursor: pointer;
+ background: #3A393B
+}
+
+.menu-list li {
+ list-style: none;
+ position: relative;
+ color: #EDEDED;
+ border-top: 1px groove black;
+}
+
+.menu-list li:first-child {
+ border: none;
+}
diff --git a/ui/js/widgets/menu-flat.js b/ui/js/widgets/menu-flat.js
new file mode 100644
index 0000000..399d091
--- /dev/null
+++ b/ui/js/widgets/menu-flat.js
@@ -0,0 +1,117 @@
+/*
+ * Project Kimchi
+ *
+ * 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.
+ * 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.
+ */
+
+ // How to use:
+ // $("#test-bar").menuFlat({
+ // content: [1,2,3,4,5,6], //Set content of the menu.
+ // icon: "icon-edit-alt", //Set icon of the menu button.
+ // listIconList: ["icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-user"]
+ // //Set icons of the menu list.
+ // // name is optional which set the name of the menu list.
+ // });
+ // $("#test-bar0").on("click", function() {
+ // alert("hello");
+ // });
+ // $("#test-bar1").on("click", function() {
+ // console.log("hello");
+ // });
+
+
+ (function( $ ) {
+ $.widget("kimchi.menuFlat", {
+
+ options: {
+ content: null,
+ name: null,
+ parentid: null,
+ icon: null,
+ listIconList: null
+ },
+
+ _create: function() {
+ var that = this;
+ var name = that.options.name || $(this.element).attr("id");
+ var value = that.options.content;
+ var icon = that.options.icon || "";
+ var parentid = $(this.element).attr("id");
+ $(parentid).css({
+ "width": "150px"
+ });
+ that.options.parentid = parentid;
+ var html = "<div class='menu-box' id='manu-" + name + "'>" +
+ "<span class='menu-icon-front " + icon + "'></span>" +
+ "<span class='menu-label'>"+ name + "</span>" +
+ "<span class='menu-icon icon-down-open'></span>" +
+ "</div>";
+ $(html).appendTo(that.element);
+ html = that._setValue(value);
+ $(html).appendTo(that.element);
+ $(".menu-box", "#" + parentid).on("click", that._toggleOpt);
+ $(".menu-opt", "#" + parentid).on("click", function() {
+ that._toggleOpt();
+ });
+ $(document).mouseup(function(e) {
+ var container = $(".menu-opt");
+ if(!container.is(e.target) && container.has(e.target).length === 0 && $(".menu-icon").hasClass("icon-up-open")) {
+ $(".menu-list", "#" + parentid).prop("style", "display:none");
+ $(".menu-icon", "#" + parentid).removeClass("icon-up-open");
+ $(".menu-icon", "#" + parentid).addClass("icon-down-open").css({
+ "background": "#4E4D4F"
+ });
+ }
+ });
+ },
+
+ _setValue: function(value) {
+ var that = this;
+ var name = that.options.name;
+ var html = "<ul class='menu-list' name='" + name + "' style='display:none'>";
+ var name = this.options.name || $(this.element).attr("id");
+ $.each(value, function(index, data) {
+ that.options.content[index] = data.toString();
+ var liIcon = that.options.listIconList[index] || "";
+ html += "<li id='" + name + index + "' class='menu-opt'>" +
+ "<span class='list-icon-front " + liIcon + "'></span>" +
+ "<span>" + data + "</span>" +
+ "</li>";
+ });
+ html += "</ul>"
+ return html;
+ },
+
+ _toggleOpt: function() {
+ if($(".menu-icon").hasClass("icon-down-open")) {
+ $(".menu-list").prop("style", "display");
+ $(".menu-icon").removeClass("icon-down-open");
+ $(".menu-icon").addClass("icon-up-open").css({
+ "background": "#3A393B"
+ });
+ } else {
+ $(".menu-list").prop("style", "display:none");
+ $(".menu-icon").removeClass("icon-up-open");
+ $(".menu-icon").addClass("icon-down-open").css({
+ "background": "#4E4D4F"
+ });
+ }
+ },
+
+ _destroy: function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 11 months
[PATCH 0/5] Storage volume tests and bug fixes
by Aline Manera
This patch set depends on:
- [PATCH] Run Model tests prior to MockModel tests
- [PATCH 0/8 V2] Storage pool tests and bug fixes
Aline Manera (5):
Bug fix: Use VIR_STORAGE_VOL_RESIZE_SHRINK flag when decreasing the
volume size
Bug fix: Allow clonning a volume from a pool with non-ASCII characters
Storage volumes: Update docs/API.md
Update rollback_wrapper function to handle nested API
Storage volume tests
docs/API.md | 4 +-
src/kimchi/model/storagevolumes.py | 24 +++--
tests/test_mock_storagevolume.py | 94 +++++++++++++++++
tests/test_model.py | 125 ++--------------------
tests/test_model_storagevolume.py | 211 +++++++++++++++++++++++++++++++++++++
tests/test_rest.py | 138 ------------------------
tests/utils.py | 4 +-
7 files changed, 336 insertions(+), 264 deletions(-)
create mode 100644 tests/test_mock_storagevolume.py
create mode 100644 tests/test_model_storagevolume.py
--
2.1.0
9 years, 11 months
Errors on ubuntu
by Thierry Fauck@linux.vnet.ibm.com
On ubuntu I am facing an issue:
While removing package kimchi I get following error:
start-stop-daemon: *unrecognized option '--remove-pidfile'*
Try 'start-stop-daemon --help' for more information.
Killed
invoke-rc.d: initscript kimchi, action "stop" failed.
dpkg: error processing package kimchi (--remove):
subprocess installed pre-removal script returned error exit status 137
Errors were encountered while processing:
kimchi
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: Operation was interrupted before it could finish
start-stop-daemon --help
Usage: start-stop-daemon [<option> ...] <command>
Commands:
-S|--start -- <argument> ... start a program and pass <arguments> to it
-K|--stop stop a program
-T|--status get the program status
-H|--help print help information
-V|--version print version
Matching options (at least one is required):
-p|--pidfile <pid-file> pid file to check
-x|--exec <executable> program to start/check if it is running
-n|--name <process-name> process name to check
-u|--user <username|uid> process owner to check
Options:
-g|--group <group|gid> run process as this group
-c|--chuid <name|uid[:group|gid]>
change to this user/group before starting
process
-s|--signal <signal> signal to send (default TERM)
-a|--startas <pathname> program to start (default is <executable>)
-r|--chroot <directory> chroot to <directory> before starting
-d|--chdir <directory> change to <directory> (default is /)
-N|--nicelevel <incr> add incr to the process' nice level
-P|--procsched <policy[:prio]>
use <policy> with <prio> for the kernel
process scheduler (default prio is 0)
-I|--iosched <class[:prio]> use <class> with <prio> to set the IO
scheduler (default prio is 4)
-k|--umask <mask> change the umask to <mask> before starting
-b|--background force the process to detach
-C|--no-close do not close any file descriptor
-m|--make-pidfile create the pidfile before starting
-R|--retry <schedule> check whether processes die, and retry
-t|--test test mode, don't do anything
-o|--oknodo exit status 0 (not 1) if nothing done
-q|--quiet be more quiet
-v|--verbose be more verbose
Hope that helps.
Thierry
--
Thierry Fauck @ linux.vnet.ibm
9 years, 11 months
[PATCH] Remove policycoreutils-python as Kimchi dependency
by Aline Manera
According to commit fcd407e, policycoreutils-python was added as a
dependency because of semanage command which is not in use anymore.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 1 -
docs/README.md | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 92d3e49..112834b 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -27,7 +27,6 @@ Requires: python-lxml
Requires: nfs-utils
Requires: nginx
Requires: iscsi-initiator-utils
-Requires: policycoreutils-python
Requires: python-ldap
Requires: python-libguestfs
Requires: libguestfs-tools
diff --git a/docs/README.md b/docs/README.md
index 0160ee5..db65c0d 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -54,8 +54,8 @@ Install Dependencies
qemu-kvm python-psutil python-ethtool sos \
python-ipaddr python-ldap python-lxml nfs-utils \
iscsi-initiator-utils libxslt pyparted nginx \
- policycoreutils-python python-libguestfs \
- libguestfs-tools python-websockify novnc
+ python-libguestfs libguestfs-tools python-websockify \
+ novnc
# If using RHEL6 or Fedora, install the following additional package:
$ sudo yum install spice-html5
--
2.1.0
9 years, 11 months
[PATCH] Update copyright according to last changes
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmsnapshots.py | 2 +-
ui/js/src/kimchi.template_edit_main.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/vmsnapshots.py b/src/kimchi/model/vmsnapshots.py
index 0c5b601..3a92cdc 100644
--- a/src/kimchi/model/vmsnapshots.py
+++ b/src/kimchi/model/vmsnapshots.py
@@ -1,7 +1,7 @@
#
# Project Kimchi
#
-# Copyright IBM, Corp. 2014
+# 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
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index f809223..a557ca5 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -1,7 +1,7 @@
/*
* Project Kimchi
*
- * Copyright IBM, Corp. 2013-2014
+ * 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.
--
2.1.0
9 years, 11 months