[PATCH] [Kimchi] Issue #1018 - Disable volume resize option on logical pool.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
It's not possible (probably by the libvirt rules on logical pools) to
resize a volume on logical pool.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storage_main.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index c23a4a6..832d3fc 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -247,7 +247,9 @@ kimchi.storageBindClick = function() {
} else {
// Read-write pools
if (poolType !== 'scsi' && poolType !== 'iscsi') {
- if (selectedVolumes.length > 1) {
+ // Not able to resize more than one volume
+ // Logical pools don't enable resize of their volumes
+ if (selectedVolumes.length > 1 || poolType === 'logical') {
disabled = ['volume-resize'];
enabled = ['volume-clone','volume-wipe','volume-delete'];
} else {
--
2.7.4
8 years, 1 month
[PATCH] [Kimchi] Fix max number of memory slots for Ubuntu on Power
by Lucio Correia
Ubuntu ppc64le has not yet pushed upstream qemu support
for 256 memory slots devices. Thus guests created by Kimchi
on that distribution cannot be started without editing XML
provided by Kimchi.
This commit is to be reverted once Ubuntu's qemu is updated
with 256 memory slots support.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
osinfo.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/osinfo.py b/osinfo.py
index 3e56d97..7c39eee 100644
--- a/osinfo.py
+++ b/osinfo.py
@@ -20,6 +20,7 @@
import copy
import glob
import os
+import platform
import psutil
from collections import defaultdict
from configobj import ConfigObj
@@ -34,14 +35,16 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),
'ppc64le': ('ppc64le'),
's390x': ('s390x')}
-
# Memory devices slot limits by architecture
-MEM_DEV_SLOTS = {'ppc64': 256,
- 'ppc64le': 256,
- 'x86_64': 256,
- 'i686': 256,
- 'i386': 256,
- 's390x': 256}
+HOST_DISTRO = platform.linux_distribution()
+MEM_DEV_SLOTS = {
+ 'ppc64': 32 if HOST_DISTRO and HOST_DISTRO[0] == 'Ubuntu' else 256,
+ 'ppc64le': 32 if HOST_DISTRO and HOST_DISTRO[0] == 'Ubuntu' else 256,
+ 'x86_64': 256,
+ 'i686': 256,
+ 'i386': 256,
+ 's390x': 256,
+}
template_specs = {'x86': {'old': dict(disk_bus='ide',
--
1.9.1
8 years, 1 month
[PATCH] [Kimchi] Issue #1017: Fix upload file to logical storage pool.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Set correct value to volume allocation and chunk size to be transfered, as well,
as condition to stop the upload of files.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
model/storagevolumes.py | 9 ++++++---
ui/js/src/kimchi.storagepool_add_volume_main.js | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/model/storagevolumes.py b/model/storagevolumes.py
index 0c710b2..b2915e1 100644
--- a/model/storagevolumes.py
+++ b/model/storagevolumes.py
@@ -141,7 +141,7 @@ class StorageVolumesModel(object):
</target>
</volume>
"""
- params.setdefault('allocation', 0)
+ params.setdefault('allocation', params['capacity'])
params.setdefault('format', 'qcow2')
name = params['name']
@@ -166,7 +166,9 @@ class StorageVolumesModel(object):
if params.get('upload', False):
upload_volumes[vol_path] = {'lock': threading.Lock(),
- 'offset': 0, 'cb': cb}
+ 'offset': 0, 'cb': cb,
+ 'expected_vol_size': params['capacity']
+ }
cb('ready for upload')
else:
cb('OK', True)
@@ -534,7 +536,8 @@ class StorageVolumeModel(object):
cb('%s/%s' % (offset + chunk_size, vol_capacity))
vol_data['offset'] += chunk_size
- if vol_data['offset'] == vol_capacity:
+ if (vol_data['offset'] == vol_capacity) or \
+ (vol_data['offset'] == vol_data['expected_vol_size']):
del upload_volumes[vol_path]
cb('OK', True)
diff --git a/ui/js/src/kimchi.storagepool_add_volume_main.js b/ui/js/src/kimchi.storagepool_add_volume_main.js
index ebace9c..e5a0a19 100644
--- a/ui/js/src/kimchi.storagepool_add_volume_main.js
+++ b/ui/js/src/kimchi.storagepool_add_volume_main.js
@@ -80,7 +80,7 @@ kimchi.sp_add_volume_main = function() {
};
var uploadFile = function() {
- var chunkSize = 8 * 1024 * 1024; // 8MB
+ var chunkSize = 2 * 1024 * 1024; // 2MB
var uploaded = 0;
var blobFile = $(localFileBox)[0].files[0];
@@ -106,7 +106,7 @@ kimchi.sp_add_volume_main = function() {
formData: fd
}, function(result) {
if (uploaded < blobFile.size){
- setTimeout(doUpload, 500);
+ setTimeout(doUpload, 500);
}
}, onError);
--
2.7.4
8 years, 1 month
[PATCH] [Kimchi] Fix issue #1019: Hide storage volume actions menu for iSCSI/SCSI pools
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storage_main.js | 57 +++++++++++++++++++++++++++-------------
ui/pages/tabs/storage.html.tmpl | 4 +--
2 files changed, 41 insertions(+), 20 deletions(-)
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 0d7a6d7..3208bd2 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -234,24 +234,37 @@ kimchi.storageBindClick = function() {
var checkbox = $(this);
var volumeBlock = $(this).closest('.wok-datagrid-row');
var volumesBlock = $(this).closest('.volumeslist');
+ var poolType = volumesBlock.data('type')
+ var selectedVolumes = $('[name="selected-volume[]"]:checked',volumesBlock)
var disabled = [];
- if($('[name="selected-volume[]"]:checked',volumesBlock).length > 1) {
- disabled = ['volume-clone','volume-wipe','volume-delete'];
- $('.volume-resize',volumesBlock).parent().addClass('disabled');
- for (i = 0; i < disabled.length; i++) {
- $('.'+disabled[i],volumesBlock).parent().removeClass('disabled');
- }
- }else if($('[name="selected-volume[]"]:checked',volumesBlock).length === 1){
- disabled = ['volume-resize','volume-clone','volume-wipe','volume-delete'];
- for (i = 0; i < disabled.length; i++) {
- $('.'+disabled[i],volumesBlock).parent().removeClass('disabled');
- }
- }else {
+ var enabled = [];
+
+ // No volume selected
+ if (selectedVolumes.length === 0) {
disabled = ['volume-resize','volume-clone','volume-wipe','volume-delete'];
- for (i = 0; i < disabled.length; i++) {
- $('.'+disabled[i],volumesBlock).parent().addClass('disabled');
+ enabled = [];
+ // One or more volumes selected
+ } else {
+ // Read-write pools
+ if (poolType !== 'scsi' && poolType !== 'iscsi') {
+ if (selectedVolumes.length > 1) {
+ disabled = ['volume-resize'];
+ enabled = ['volume-clone','volume-wipe','volume-delete'];
+ } else {
+ disabled = [];
+ enabled = ['volume-resize','volume-clone','volume-wipe', 'volume-delete'];
+ }
}
}
+
+ for (i = 0; i < disabled.length; i++) {
+ $('.'+disabled[i],volumesBlock).parent().addClass('disabled');
+ }
+
+ for (i = 0; i < enabled.length; i++) {
+ $('.'+enabled[i],volumesBlock).parent().removeClass('disabled');
+ }
+
if(checkbox.is(":checked")){
volumeBlock.addClass('selected');
}else {
@@ -293,19 +306,27 @@ kimchi.storageBindClick = function() {
}
});
- $('.pool-add-volume').each(function(index) {
+ $('.volume-add').each(function(index) {
var canAddVolume =
$(this).data('stat') === 'active' &&
$(this).data('type') !== 'iscsi' &&
$(this).data('type') !== 'scsi';
if(canAddVolume) {
- $(this).parent().show();
+ $(this).parent().removeClass('disabled');
}
else {
- $(this).parent().hide();
+ $(this).parent().addClass('disabled');
}
});
+ $('.volumeslist').each(function(index) {
+ var rwpool = $(this).data('type') !== 'iscsi' &&
+ $(this).data('type') !== 'scsi'
+
+ if (!rwpool)
+ $('.pool-action', $(this)).addClass('hidden');
+ });
+
if(wok.tabMode['storage'] === 'admin') {
$('.pool-delete').on('click', function(event) {
event.preventDefault();
@@ -382,7 +403,7 @@ kimchi.storageBindClick = function() {
}
});
- $('.pool-add-volume').on('click', function(event) {
+ $('.volume-add').on('click', function(event) {
event.preventDefault();
var poolName = $(this).data('name');
kimchi.selectedSP = poolName;
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index 92d9b75..65d6d19 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -125,13 +125,13 @@
</span>
</span>
<div class="volumes">
- <div id="volume-{name}" class="volumeslist" data-name="{name}">
+ <div id="volume-{name}" class="volumeslist" data-name="{name}" data-type="{type}">
<div class="row">
<div class="pull-left">
<div class="dropdown menu-flat pool-action">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span class="edit-alt"></span>$_("Actions")<span class="caret"></span></button>
<ul class="dropdown-menu actionsheet">
- <li><a href="#" class="pool-add-volume" data-stat="{state}" data-name="{name}" data-type="{type}"><i class="fa fa-plus-circle"></i> $_("Add Volume")</a></li>
+ <li class="disabled"><a href="#" class="volume-add" data-stat="{state}" data-name="{name}" data-type="{type}"><i class="fa fa-plus-circle"></i> $_("Add Volume")</a></li>
<li class="disabled"><a href="#" class="volume-resize" data-name="{name}"><i class="fa fa-external-link-square"></i> $_("Resize")</a></li>
<li class="disabled"><a href="#" class="volume-clone" data-name="{name}"><i class="fa fa-copy"></i> $_("Clone")</a></li>
<li class="disabled"><a href="#" class="volume-wipe" data-name="{name}"><i class="fa fa-eraser"></i> $_("Wipe")</a></li>
--
2.5.5
8 years, 1 month
[PATCH] [Kimchi] Bug fix #521: Extend logical pool
by Aline Manera
This patch proper shows the extend logical pool dialog to collect user
information and do the request.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/css/kimchi.css | 3 +-
ui/css/src/modules/_guests.scss | 3 +-
ui/js/src/kimchi.storage_main.js | 81 ++++++++++++++++++++------------
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.json.tmpl | 9 ++--
ui/pages/tabs/storage.html.tmpl | 45 +++++++++---------
6 files changed, 83 insertions(+), 60 deletions(-)
diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css
index 959508f..9a9ff25 100644
--- a/ui/css/kimchi.css
+++ b/ui/css/kimchi.css
@@ -294,7 +294,8 @@
font-size: 32px;
}
-#wok-confirm-modal .modal-body strong {
+#wok-confirm-modal .modal-body strong,
+.modal-dialog .modal-body strong {
border-bottom: 1px dotted;
}
diff --git a/ui/css/src/modules/_guests.scss b/ui/css/src/modules/_guests.scss
index 237b395..4947123 100644
--- a/ui/css/src/modules/_guests.scss
+++ b/ui/css/src/modules/_guests.scss
@@ -46,7 +46,8 @@
}
}
-#wok-confirm-modal .modal-body strong {
+#wok-confirm-modal .modal-body strong,
+.modal-dialog .modal-body strong {
border-bottom: 1px dotted;
}
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 0d7a6d7..741fd59 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -410,10 +410,8 @@ kimchi.storageBindClick = function() {
$('.pool-extend').on('click', function(event) {
event.preventDefault();
- //$("#logicalPoolExtend").dialog("option", "poolName", $(this).data('name'));
- //$("#logicalPoolExtend").dialog("open");
- partitions = $(this).data('name');
- //$("#logicalPoolExtend").dialog("option", "poolName", $(this).data('name'));
+ var poolName = $(this).data('name');
+ kimchi.selectedSP = poolName;
});
}
@@ -478,17 +476,23 @@ kimchi._generateVolumeHTML = function(volume) {
return volumeHtml[0].outerHTML;
};
+
+kimchi.getPoolUsageIcon = function(usage) {
+ if (usage <= 100 && usage >= 85)
+ return 'icon-high';
+
+ if (usage <= 85 && usage >= 75)
+ return 'icon-med';
+
+ return 'icon-low';
+};
+
+
kimchi.doUpdateStoragePool = function(poolObj){
var poolName = poolObj.data('name');
kimchi.getStoragePool(poolName, function(result) {
result.usage = Math.round(result.allocated / result.capacity * 100) || 0;
- if (result.usage <= 100 && result.usage >= 85) {
- result.icon = 'icon-high';
- }else if (result.usage <= 85 && result.usage >= 75 ) {
- result.icon = 'icon-med';
- } else {
- result.icon = 'icon-low';
- }
+ result.icon = kimchi.getPoolUsageIcon(result.usage);
result.allocated = wok.changetoProperUnit(result.allocated,1);
$('> .column-usage > .usage-icon',poolObj).attr('class', 'usage-icon').addClass(result.icon).text(result.usage);
$('> .column-allocated',poolObj).attr('val',result.allocated).text(result.allocated);
@@ -649,30 +653,45 @@ kimchi.doListVolumes = function(poolObj) {
}, false);
};
- kimchi.initLogicalPoolExtend = function() {
-
+kimchi.initLogicalPoolExtend = function() {
$('#logicalPoolExtend').on('hidden.bs.modal', function () {
$('.host-partition', '#logicalPoolExtend').empty();
});
$('#logicalPoolExtend').on('show.bs.modal', function() {
- //$('#logicalPoolExtend2').find('.modal-content').html();
- kimchi.listHostPartitions(function(partitions) {
- $('#loading-info', '#logicalPoolExtend').removeClass('hidden');
- if (partitions.length > 0) {
- for (var i = 0; i < partitions.length; i++) {
- if (partitions[i].type === 'part' || partitions[i].type === 'disk') {
- $('.host-partition', '#logicalPoolExtend').append(wok.substitute($('#logicalPoolExtendTmpl').html(), partitions[i]));
- $('#savePartitions', '#logicalPoolExtend').prop('disabled', false);
+ // Make any change in the form fields enables the
+ // 'savePartitions' button if all the visible form
+ // fields are filled, disables it otherwise.
+ $('#logicalPoolExtend').on('input change propertychange', function() {
+ if ($("input[name=devices]:checked").length === 0) {
+ $("#savePartitions").attr("disabled", true);
+ }
+ else {
+ $("#savePartitions").attr("disabled", false);
+ }
+ });
+
+ kimchi.listHostPartitions(function(data) {
+ if (data.length > 0) {
+ var deviceHtml = $('#partitionTmpl').html();
+ var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>Device</th><th>Path</th><th>Size (GiB)</th></tr></thead><tbody>';
+ valid_types = ['part', 'disk', 'mpath'];
+ $.each(data, function(index, value) {
+ if (valid_types.indexOf(value.type) !== -1) {
+ value.size = (value.size / 1000000000).toFixed(2);
+ listHtml += wok.substitute(deviceHtml, value);
}
- }
+ });
+ listHtml += '</tbody></table>';
+ var infoHtml = '<h3>' + i18n['KCHPOOL6019M'].replace('%1', '<strong>' + kimchi.selectedSP + '</strong>') + '</h3>';
+ $('.host-partition', '#logicalPoolExtend').html(infoHtml + listHtml);
} else {
- $('#loading-info', '#logicalPoolExtend').addClass('hidden');
$('.host-partition').html(i18n['KCHPOOL6011M']);
+ $('.host-partition').addClass('text-help');
}
}, function(err) {
- $('#loading-info', '#logicalPoolExtend').addClass('hidden');
$('.host-partition').html(i18n['KCHPOOL6013M'] + '<br/>(' + err.responseJSON.reason + ')');
+ $('.host-partition').addClass('text-help');
});
$('#savePartitions', '#logicalPoolExtend').on('click', function(event) {
@@ -681,14 +700,16 @@ kimchi.doListVolumes = function(poolObj) {
$("input[type='checkbox']:checked", "#logicalPoolExtend").each(function() {
devicePaths.push($(this).prop('value'));
});
- kimchi.updateStoragePool($("#logicalPoolExtend"), {
+ kimchi.updateStoragePool(kimchi.selectedSP, {
disks: devicePaths
- }, function(partitions) {
- var item = $("#" + $("#logicalPoolExtend").dialog("option", "poolName"));
+ }, function(pool) {
$('#logicalPoolExtend').modal('hide');
- $(".usage", $(".storage-name", item)).text((Math.round(partitions.allocated / partitions.capacity * 100) || 0) + "%");
- $(".storage-text", $(".storage-capacity", item)).text(wok.changetoProperUnit(partitions.capacity, 1));
- $(".storage-text", $(".storage-allocate", item)).text(wok.changetoProperUnit(partitions.allocated, 1));
+ var item = '#' + pool.name;
+ var usage = Math.round(pool.allocated / pool.capacity * 100) || 0;
+ var usageIcon = kimchi.getPoolUsageIcon(usage);
+ $(".usage-icon", $(".column-usage", item)).attr('class', 'usage-icon').addClass(usageIcon).text(usage);
+ $(".column-capacity", item).text(wok.changetoProperUnit(pool.capacity, 1));
+ $(".column-allocated", item).text(wok.changetoProperUnit(pool.allocated, 1));
}, function(err) {
$('#savePartitions', '#logicalPoolExtend').prop('disabled', true);
$('#logicalPoolExtend').modal('hide');
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 3fe2548..5a020ee 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -127,7 +127,7 @@ kimchi.initStorageAddPage = function() {
kimchi.listHostPartitions(function(data) {
if (data.length > 0) {
var deviceHtml = $('#partitionTmpl').html();
- var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>device</th><th>path</th><th>size (GiB)</th></tr></thead><tbody>';
+ var listHtml = '<table class="table table-hover"><thead><tr><th></th><th>Device</th><th>Path</th><th>Size (GiB)</th></tr></thead><tbody>';
valid_types = ['part', 'disk', 'mpath'];
$.each(data, function(index, value) {
if (valid_types.indexOf(value.type) !== -1) {
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index 7beee19..c67e9e8 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -103,10 +103,6 @@
"KCHPOOL6008M": "$_("Failed to load iSCSI targets.")",
"KCHPOOL6009M": "$_("Would you like to continue?")",
"KCHPOOL6010M": "$_("This will permanently delete the following storage volumes: %1")",
-
- "KCHPOOL6005E": "$_("Invalid NFS mount path.")",
- "KCHPOOL6006E": "$_("No logical device selected.")",
- "KCHPOOL6009E": "$_("This is not a valid Server Name or IP. Please, modify it.")",
"KCHPOOL6011M": "$_("No available partitions found.")",
"KCHPOOL6012M": "$_("The %1 storage pool is not persistent. Instead of deactivate, this action will permanently delete it. Would you like to continue?")",
"KCHPOOL6013M": "$_("Unable to retrieve partitions information.")",
@@ -115,6 +111,11 @@
"KCHPOOL6016M": "$_("No LVM found in the system.")",
"KCHPOOL6017M": "$_("This will permanently wipe the following storage volumes: %1")",
"KCHPOOL6018M": "$_("Wipe Confirmation")",
+ "KCHPOOL6019M": "$_("Select one or more partitions to be added to the logical pool %1:")",
+
+ "KCHPOOL6005E": "$_("Invalid NFS mount path.")",
+ "KCHPOOL6006E": "$_("No logical device selected.")",
+ "KCHPOOL6009E": "$_("This is not a valid Server Name or IP. Please, modify it.")",
"KCHVMSTOR0001E": "$_("CDROM path needs to be a valid local/remote path and cannot be blank.")",
"KCHVMSTOR0002E": "$_("Disk pool or volume cannot be blank.")",
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index 92d9b75..4215d55 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -74,21 +74,21 @@
<div id="logicalPoolExtend" class="modal fade logicalpool-modal" tabindex="-2" role="dialog" aria-labelledby="logicalPoolExtendLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
- <div class="modal-header">
+ <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title" id="logicalPoolExtendLabel">$_("Device path")</h4>
- </div>
- <div class="modal-body">
- <p id="loading-info" class="hidden"><span class="wok-loading-icon"></span><span>$_("Looking for available partitions ...")</span></p>
- <div class="host-partition">
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" id="savePartitions" class="btn btn-default" disabled="disabled">$_("Save")</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">$_("Cancel")</button>
- </div>
+ <h4 class="modal-title" id="logicalPoolExtendLabel">$_("Extending logical pool")</h4>
+ </div>
+ <div class="modal-body">
+ <div class="host-partition">
+ <span class="wok-loading-icon"></span><span>$_("Looking for available partitions ...")</span>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" id="savePartitions" class="btn btn-default" disabled="disabled">$_("Save")</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal">$_("Cancel")</button>
+ </div>
</div>
- </div>
+ </div>
</div>
</div>
<div class="wok-mask">
@@ -200,17 +200,16 @@
</div>
</li>
</script>
-<script id="logicalPoolExtendTmpl" type="html/text">
- <div>
- <input type="checkbox" class="wok-checkbox" id="{name}" value="{path}" name="devices">
- <label for="{name}">
- <div>
- <span class="device-name">{name}</span>
- <span class="device-path">{path}</span>
- </div>
- </label>
- </div>
+
+<script id="partitionTmpl" type="html/text">
+ <tr>
+ <td><input type="checkbox" class="wok-checkbox" id="{name}" value="{path}" name="devices"><label for="{name}"></label></td>
+ <td>{name}</td>
+ <td>{path}</td>
+ <td>{size}</td>
+ </tr>
</script>
+
<script>
kimchi.storage_main();
</script>
--
2.5.5
8 years, 1 month
[PATCH] [Kimchi] Fix issue #1022: Remove 'Clone' option for running guests
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_main.js | 1 -
ui/pages/guest.html.tmpl | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 34217e4..f734837 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -640,7 +640,6 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
//Setup the VM Actions
var guestActions = result.find("div[name=guest-actions]");
guestActions.find(".shutoff-disabled").prop("disabled", !vmRunningBool);
- guestActions.find(".running-disabled").prop("disabled", vmRunningBool);
guestActions.find(".non-persistent-disabled").prop("disabled", !vmPersistent);
guestActions.find(".reset-disabled").prop("disabled", vmPoweredOffBool || !vmPersistent);
guestActions.find(".pause-disabled").prop("disabled", vmPoweredOffBool || !vmPersistent);
diff --git a/ui/pages/guest.html.tmpl b/ui/pages/guest.html.tmpl
index 389ba9d..cc09aa0 100644
--- a/ui/pages/guest.html.tmpl
+++ b/ui/pages/guest.html.tmpl
@@ -61,9 +61,8 @@
<ul class="dropdown-menu" role="menu">
<li role="presentation"><a nwAct="connect-vnc" class='shutoff-disabled' name="vm-console" href="#"><i class="fa fa-list-alt"></i>$_("View Console")</a></li>
<li role="presentation"><a nwAct="connect-serial-console" class='shutoff-hidden' name="vm-serial-console" href="#"><i class="fa fa-list-alt"></i>$_("View Serial")</a></li>
- <!-- <li role="presentation"><a nwAct="view-vnc" class='shutoff-disabled' name="vm-view-vnc" href="#"><i class="fa fa-eye"></i>$_("View VNC Console")</a></li> -->
<li role="presentation"><a nwAct="edit" name="vm-edit" href="#"><i class="fa fa-pencil"></i>$_("Edit")</a></li>
- <li role="presentation"><a nwAct="clone" class='running-disabled' name="vm-clone" href="#"><i class="fa fa-copy"></i>$_("Clone")</a></li>
+ <li role="presentation"><a nwAct="clone" class='running-hidden' name="vm-clone" href="#"><i class="fa fa-copy"></i>$_("Clone")</a></li>
<li role="presentation"><a nwAct="migrate" name="vm-migrate" href="#"><i class="fa fa-exchange"></i>$_("Migrate")</a></li>
<li role="presentation"><a nwAct="reset" class='shutoff-hidden non-persistent-disabled' name="vm-reset" href="#"><i class="fa fa-refresh"></i>$_("Reset")</a></li>
<li role="presentation"><a nwAct="pause" class='pause-hidden non-persistent-disabled' name="vm-pause" href="#"><i class="fa fa-pause"></i>$_("Pause")</a></li>
--
2.5.5
8 years, 1 month
[PATCH][Kimchi] Issue #962: Suggestion to check spec guidelines
by Ramon Medeiros
Run rpmlint on check-local
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Makefile.am | 5 ++++-
check_spec_errors.sh | 36 ++++++++++++++++++++++++++++++++++++
configure.ac | 1 +
docs/fedora-deps.md | 2 +-
docs/opensuse-deps.md | 2 +-
5 files changed, 43 insertions(+), 3 deletions(-)
create mode 100755 check_spec_errors.sh
diff --git a/Makefile.am b/Makefile.am
index b39f9e3..dee6aae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,10 @@ check-local:
&& echo "ERROR: Whitespaces found" || echo "Ok"; \
echo "IBM copyright year verification ..." ; \
/bin/bash ../../../../check-IBM-license-header.sh ; \
- fi
+ fi;
+ @if [ -f $(RPMLINT) ]; then \
+ ./check_spec_errors.sh; \
+ fi;
# Link built mo files in the source tree to enable use of translations from
# within the source tree
diff --git a/check_spec_errors.sh b/check_spec_errors.sh
new file mode 100755
index 0000000..5e43d8b
--- /dev/null
+++ b/check_spec_errors.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#
+# Project Wok
+#
+# Copyright IBM Corp, 2016
+#
+# 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
+
+echo "Checking spec guidelines"
+
+# create links
+cp contrib/kimchi.spec.fedora contrib/kimchi_fedora.spec
+cp contrib/kimchi.spec.suse contrib/kimchi_suse.spec
+
+# run checking
+rpmlint contrib/kimchi_fedora.spec
+rpmlint contrib/kimchi_suse.spec
+
+# remove links
+rm contrib/kimchi_fedora.spec
+rm contrib/kimchi_suse.spec
+
+
diff --git a/configure.ac b/configure.ac
index 870ac0c..cafff0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,7 @@ AM_INIT_AUTOMAKE([-Wno-portability])
AM_PATH_PYTHON([2.6])
AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8])
AC_PATH_PROG([GIT], [git], [/usr/bin/git])
+AC_PATH_PROG([RPMLINT], [rpmlint], [/usr/bin/rpmlint])
AC_PYTHON_MODULE([unittest])
AC_SUBST([HAVE_PYMOD_UNITTEST])
AC_SUBST([PYTHON_VERSION])
diff --git a/docs/fedora-deps.md b/docs/fedora-deps.md
index ca24994..65ad987 100644
--- a/docs/fedora-deps.md
+++ b/docs/fedora-deps.md
@@ -47,7 +47,7 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo yum install pyflakes python-pep8 python-requests python-mock
+ $ sudo yum install pyflakes python-pep8 python-requests python-mock rpmlint
# For RHEL systems, install the additional packages:
$ sudo yum install python-unittest2
diff --git a/docs/opensuse-deps.md b/docs/opensuse-deps.md
index a69dacd..1c5fc23 100644
--- a/docs/opensuse-deps.md
+++ b/docs/opensuse-deps.md
@@ -45,4 +45,4 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo zypper install python-pyflakes python-pep8 python-requests python-mock
+ $ sudo zypper install python-pyflakes python-pep8 python-requests python-mock rpmlint
--
2.5.5
8 years, 1 month
[PATCH][Wok] Issue #166: wok is pointing to /etc/nginx/conf.d which does not exists on OpenSuse 42.1
by Ramon Medeiros
Create dir if not exist
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
src/wok/proxy.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/wok/proxy.py b/src/wok/proxy.py
index b68b86e..4b06fc2 100644
--- a/src/wok/proxy.py
+++ b/src/wok/proxy.py
@@ -116,6 +116,11 @@ def _create_proxy_config(options):
# SSL certifications.
if not paths.installed:
dst = os.path.join(paths.sys_nginx_conf_dir, "wok.conf")
+
+ # directoy does not exist: create it
+ if not os.path.exists(paths.sys_nginx_conf_dir):
+ os.makedirs(paths.sys_nginx_conf_dir)
+
if os.path.isfile(dst) or os.path.islink(dst):
os.remove(dst)
os.symlink(os.path.join(nginx_config_dir, "wok.conf"), dst)
--
2.5.5
8 years, 1 month
[PATCH] [Wok] Fix Kimchi issue #1032: Remove 'Peers' dropdown from Wok header
by Aline Manera
The federation feature (provided by Kimchi) is responsible to list the
peers found in the same network using openSLP.
The UI for this feature is done in Kimchi code by extending the
Dashboard tab content (provided by Ginger Base). So remove any reference
to peers in Wok source code.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/css/theme-default/topbar.css | 34 ----------------------------------
ui/pages/wok-ui.html.tmpl | 7 -------
2 files changed, 41 deletions(-)
diff --git a/ui/css/theme-default/topbar.css b/ui/css/theme-default/topbar.css
index 33624aa..43b8b39 100644
--- a/ui/css/theme-default/topbar.css
+++ b/ui/css/theme-default/topbar.css
@@ -177,40 +177,6 @@ a#btn-logout:hover {
}
}
-.peers {
- color: white;
- cursor: pointer;
- height: 52px;
- margin: 0 12px;
-}
-
-.peers span {
- margin-top: 25px;
-}
-
-.peers .arrow {
- border: 6px solid transparent;
- border-bottom: none;
- border-top-color: white;
- display: inline-block;
- width: 0;
-}
-
-.peers .dropdown {
- top: 45px;
- right: 110px;
- color: black;
- padding: 10px 15px;
- white-space: nowrap;
- line-height: 12px;
- width: inherit;
-}
-
-.peers .dropdown a {
- display: block;
- padding: 10px;
-}
-
.hide-content {
display: none!important;
}
diff --git a/ui/pages/wok-ui.html.tmpl b/ui/pages/wok-ui.html.tmpl
index e49b602..22a67e7 100644
--- a/ui/pages/wok-ui.html.tmpl
+++ b/ui/pages/wok-ui.html.tmpl
@@ -123,13 +123,6 @@
<a id="logo" class="navbar-brand" href="#" title="Wok">Wok</a>
</div>
<ul class="nav navbar-nav navbar-right">
- <li class="dropdown hide-content peers" id="peers">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="topbar-text">$_("Peers")</span><span class="caret"></span></a>
- <ul class="dropdown-menu">
- <li id="search-peers"><span>$_("Searching")...</span></li>
- <li id="no-peers" class="hide-content">$_("No peers found.")</li>
- </ul>
- </li>
<li class="dropdown" id="user-login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user" id="user-icon"></i><span class="topbar-text empty-when-logged-off" id="user-name"></span><span class="caret"></span>
--
2.5.5
8 years, 1 month
[PATCH] [Kimchi] Bug fix: Recognize Fedora 24 ISO
by Aline Manera
Fix regex to get the right Fedora versin while scanning a Fedora 25 ISO
file.
Without this patch, while trying to use a Fedora 24 ISO, the version is
set to 1 instead of 24 as the Volume id is: Fedora-WS-Live-24-1-2
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
isoinfo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/isoinfo.py b/isoinfo.py
index 6356698..5eb68ab 100644
--- a/isoinfo.py
+++ b/isoinfo.py
@@ -119,7 +119,7 @@ iso_dir = [
('ubuntu', lambda m: m.group(2), '[Uu]buntu(-Server)? (\d+\.\d+)'),
('fedora', lambda m: m.group(1), 'Fedora[ -](\d+)'),
('fedora', lambda m: m.group(1), 'Fedora.*-(\d+)-'),
- ('fedora', lambda m: m.group(1), 'Fedora-[\w-]+-(\d+)'),
+ ('fedora', lambda m: m.group(1), 'Fedora-[\D-]+-(\d+)'),
('gentoo', lambda m: m.group(1), 'Gentoo Linux \w+ (\d+)'),
('powerkvm', 'live_cd', 'POWERKVM_LIVECD'),
('arch', lambda m: m.group(1), 'ARCH_(\d+)'),
--
2.5.5
8 years, 1 month