[PATCH] Fix Key Error when editing CD ROM path
by Christy Perez
lxml only accepts strings as parameters when looking
up xml elements. The port for remote ISO was being
passed in as an int, and a KeyError was thrown.
This patch just casts the ints to strings for the
lookups.
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmstorages.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index cd985fa..5543f40 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -68,7 +68,8 @@ def _get_storage_xml(params, ignore_source=False):
if src_type == 'network':
output = urlparse.urlparse(params.get('path'))
host = E.host(name=output.hostname, port=
- output.port or socket.getservbyname(output.scheme))
+ str(output.port) or
+ str(socket.getservbyname(output.scheme)))
source = E.source(protocol=output.scheme, name=output.path)
source.append(host)
disk.append(source)
--
1.9.3
10 years, 4 months
[PATCH V4 0/5] vm ticket in backend
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V3 -> V4:
test case not pass. fix it.
V2 -> V3:
do not make ticket as sub-resource of a VM
V1 -> V2:
make ticket as sub-resource of a VM
A ticket is the credential to access VM.
Only who get the ticket can access a VM.
test this patch set:
set the ticket
$ sudo curl -k -u <user>:<password> -H "Content-Type: application/json" -H \
"Accept: application/json" https://localhost:8001/vms/test-vm-8/ \
-X PUT -d '{"ticket": {"passwd": "abcd"}}'
get the ticket
$ sudo curl -k -u <user>:<password> -H "Content-Type: application/json" -H \
"Accept: application/json" https://localhost:8001/vms/test-vm-8/
ShaoHe Feng (5):
vm ticket in backend: update API.md
vm ticket in backend: update controller and API.json
vm ticket in backend: update model
vm ticket in backend: update mockmodel
vm ticket in backend: update test case
docs/API.md | 7 +++++
src/kimchi/API.json | 16 +++++++++++
src/kimchi/control/vms.py | 3 +-
src/kimchi/i18n.py | 2 ++
src/kimchi/mockmodel.py | 14 +++++++++
src/kimchi/model/vms.py | 73 +++++++++++++++++++++++++++++++++++++++++++++++
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 17 ++++++++++-
tests/test_rest.py | 12 ++++++++
9 files changed, 143 insertions(+), 3 deletions(-)
--
1.9.3
10 years, 4 months
Blocking progress of issue #395: VM console does not work on iPads
by Wen Wang
Hi all,
I can take this bug whereas there is another issue that blocking this
progress. I cannot connect to vnc server using iPad with neither Safari
nor Chrome. The Chrome on PC works just fine. Please take a look at the
connection problem before we go through this issue.
Wang Wen
10 years, 4 months
[PATCHv5 0/7] Support image based template
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v4>v5,
Because '/tmp' used tmpfs, but kimchi used 'cache=none' when create vm, so when create image
on '/tmp' result in create vm fails, fix this error.
Also clear some files created in test. (Aline)
v3>v4,
Aggreated image scanning and name generate logic to vmtemplate.py
to avoid duplicate code.
Updated testcases accordingly.
v2>v3,
Clear unused iso link,
Adding mockmodel and tests
How to test:
create a image using:
POST /templates {'name':'mytemp', 'disks':[{'base':'a_base_img_path'}]}
create a vm using:
POST /vms {'template': '/templates/mytemp', 'pool'....}
Royce Lv (7):
Add image probe function
Change doc and api specification
Change 'cdrom' to a optional param
Fix: Prevent iso links filling in osinfo.py
Create volume based on backing store image
Update mockmodel of base img vm
Add tests for image based template
Makefile.am | 1 +
contrib/DEBIAN/control.in | 4 +-
contrib/kimchi.spec.fedora.in | 2 +
contrib/kimchi.spec.suse.in | 2 +
docs/API.md | 3 +-
docs/README.md | 9 ++-
src/kimchi/API.json | 8 ++-
src/kimchi/control/storagevolumes.py | 2 +-
src/kimchi/control/templates.py | 2 +-
src/kimchi/exception.py | 4 ++
src/kimchi/i18n.py | 8 ++-
src/kimchi/imageinfo.py | 66 ++++++++++++++++++++++
src/kimchi/mockmodel.py | 21 +++----
src/kimchi/model/templates.py | 12 +---
src/kimchi/model/vms.py | 1 +
src/kimchi/osinfo.py | 24 +-------
src/kimchi/vmtemplate.py | 104 +++++++++++++++++++++++++----------
tests/test_mockmodel.py | 12 ++--
tests/test_model.py | 31 +++++++++++
tests/test_osinfo.py | 8 ---
tests/test_rest.py | 44 +++++++++++++--
tests/test_vmtemplate.py | 25 ++++++---
22 files changed, 287 insertions(+), 106 deletions(-)
create mode 100644 src/kimchi/imageinfo.py
--
1.8.3.2
10 years, 4 months
[PATCH v9 0/5] Host device passthrough: Summary
by Zhou Zheng Sheng
Hi all,
v9:
Update API.md, API.json, unit tests and MockModel. Investigated
distro compatibility problems, adapted to Fedora 20, Fedora 19 and
Ubuntu 14.04.
v8:
Change the URI for listing affected passthrough devices, suggested by
Aline. Move hostdev.py to src/kimchi/model.py. Still discussing API
with the front-end developer. Once the API accepted, The author should
add tests for model and mockmodel, and change API.md and API.json
accordingly.
v7:
Some minor coding style improvements.
v6:
Do not passthrough PCI device of class code 0x07. It might contains
system device not suitable to assign to guest.
v5:
Filter ealigible pci devices according to pci class. When assigning a
device to VM, check if there are other VMs holding it. Use
"kimchi.model.utils.get_vm_config_flag()" to correctly set the device
attaching API flag.
v4:
Add new sub-collection to host device to list the VMs holding the device.
v3:
Fix a small naming error introduced by rebase.
v2:
Handle the devices in VM's sub-collection "hostdevs".
v1:
Handle the devices in VM template.
This patch series is to enable Kimchi to assign hos devices directly to
a VM, thus greately improve VM performance. Currently we support assigning
PCI device, USB device and SCSI LUN. For example, we can assign an NIC
to VM to improve guest network throughput, or passthrough a USB camera
to enable the guest OS to record video.
Host devices form a tree. We can assign most of the devices in the tree
to VM. By assigning a device, all the devices in its sub-tree are also
assigned. It might not make sense to assign a USB controller, because
the host may be using one of the devices connected to the controller.
Instead, Kimchi just presents the "leaf" devices to assign to guest.
In recent Linux kernel and KVM, it is able to recognize the IOMMU group
of a PCI device. The "leaf" PCI devices in the same IOMMU group should
be assigned and dismissed together. The IOMMU group is the actual
smallest isolation granularity of the PCI devices.
The first patch is to list all host devices information. It's useful on
its own to show host devices information.
The second patch is to list all eligible host devices to assign, as well
as the "affected" devices in the same IOMMU group.
The third patch creates a sub-collection "hostdevs" to the VM resource,
and deals with assigning and dismissing devices.
The fourth patch adds a sub-collection "vm_holders" to the host device
resource. It's to list all VMs that are holding the device.
Zhou Zheng Sheng (5):
Host device passthrough: List all types of host devices
Host device passthrough: List eligible device to passthrough
Host device passthrough: Directly assign and dissmis host device from
VM
Host device passthrough: List VMs that are holding a host device
Host device passthrough: Add unit tests and documents
docs/API.md | 66 ++++++-
src/kimchi/API.json | 31 +++
src/kimchi/control/host.py | 7 +
src/kimchi/control/vm/hostdevs.py | 44 +++++
src/kimchi/featuretests.py | 10 +-
src/kimchi/i18n.py | 10 +
src/kimchi/mockmodel.py | 127 ++++++++++++-
src/kimchi/model/config.py | 2 +
src/kimchi/model/host.py | 39 ++--
src/kimchi/model/hostdev.py | 337 +++++++++++++++++++++++++++++++++
src/kimchi/model/libvirtstoragepool.py | 18 +-
src/kimchi/model/vmhostdevs.py | 324 +++++++++++++++++++++++++++++++
src/kimchi/rollbackcontext.py | 3 +
src/kimchi/xmlutils.py | 26 ++-
tests/test_model.py | 31 +++
tests/test_rest.py | 12 +-
tests/test_storagepool.py | 7 +-
17 files changed, 1042 insertions(+), 52 deletions(-)
create mode 100644 src/kimchi/control/vm/hostdevs.py
create mode 100644 src/kimchi/model/hostdev.py
create mode 100644 src/kimchi/model/vmhostdevs.py
--
1.9.3
10 years, 4 months
Doubts about documentation - sudo
by Ramon Medeiros
Hi,
how kimchi are using total sudo for users? Today i used a custom sudo
for a user:
# defined libvirt as a category
Cmnd_Alias LIBVIRT = /bin/virsh
# add category to user
%phcoder ALL = NETWORKING, LIBVIRT
Can we change the documentation?
--
Ramon Nunes Medeiros
RHEV-H Blue for Troy & Sparta Focal Point
Software Engineer - Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com
10 years, 4 months
[PATCH] UI bug fix: Properly display partitions when extending a logical pool
by Aline Manera
Commit f7ec8f0e replaced kimchi.template to kimchi.substitute but a
occurence was not properly updated.
And it was preventing user to extend a logical pool as any partition
was displayed.
Fix it.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storage_main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 49fcc4a..849eb5e 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -216,7 +216,7 @@ kimchi.initLogicalPoolExtend = function() {
if (data.length > 0) {
for(var i=0;i<data.length;i++){
if (data[i].type === 'part' || data[i].type === 'disk') {
- $('.host-partition', '#logicalPoolExtend').append(kimchi.template($('#logicalPoolExtendTmpl').html(), data[i]));
+ $('.host-partition', '#logicalPoolExtend').append(kimchi.substitute($('#logicalPoolExtendTmpl').html(), data[i]));
}
}
} else {
--
1.9.3
10 years, 4 months
[PATCH] Fix pep8 errors according to pep8 1.5.6
by alinefm@linux.vnet.ibm.com
From: Aline Manera <alinefm(a)linux.vnet.ibm.com>
After updating pep8 to 1.5.6 multiple errors were identified.
Fix them.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/auth.py | 2 +-
src/kimchi/control/base.py | 4 ++--
src/kimchi/control/debugreports.py | 2 +-
src/kimchi/control/utils.py | 2 +-
src/kimchi/mockmodel.py | 20 ++++++++++----------
src/kimchi/model/storagepools.py | 6 +++---
src/kimchi/model/utils.py | 8 +++++---
src/kimchi/model/vmstorages.py | 4 ++--
src/kimchi/swupdate.py | 2 +-
src/kimchi/template.py | 2 +-
src/kimchi/utils.py | 1 +
tests/test_model.py | 4 ++--
tests/test_rest.py | 16 ++++++++--------
tests/utils.py | 4 ++--
14 files changed, 40 insertions(+), 37 deletions(-)
diff --git a/src/kimchi/auth.py b/src/kimchi/auth.py
index e2a0a05..f775205 100644
--- a/src/kimchi/auth.py
+++ b/src/kimchi/auth.py
@@ -70,7 +70,7 @@ def __init__(self, username):
self.user[USER_ROLES] = dict.fromkeys(tabs, 'user')
def get_groups(self):
- out, err, rc = run_command([ 'id', '-Gn', self.user[USER_NAME] ])
+ out, err, rc = run_command(['id', '-Gn', self.user[USER_NAME]])
if rc == 0:
self.user[USER_GROUPS] = out.rstrip().split(" ")
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index 4d1351f..bfc20bf 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -161,8 +161,8 @@ def is_authorized(self):
if (users is not None or groups is not None) and \
user_role and user_role != 'admin' and \
- (user_name not in users or \
- (groups and list(set(user_groups) & set(groups)) == [])):
+ (user_name not in users or
+ (groups and list(set(user_groups) & set(groups)) == [])):
return False
return True
diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py
index debc2eb..ce20987 100644
--- a/src/kimchi/control/debugreports.py
+++ b/src/kimchi/control/debugreports.py
@@ -32,7 +32,7 @@ def __init__(self, model):
def _get_resources(self, filter_params):
res_list = super(DebugReports, self)._get_resources(filter_params)
- return sorted(res_list, key=lambda x:x.data['time'], reverse=True)
+ return sorted(res_list, key=lambda x: x.data['time'], reverse=True)
class DebugReport(Resource):
diff --git a/src/kimchi/control/utils.py b/src/kimchi/control/utils.py
index c39dbd8..485a2a1 100644
--- a/src/kimchi/control/utils.py
+++ b/src/kimchi/control/utils.py
@@ -55,7 +55,7 @@ def validate_method(allowed, role_key, admin_methods):
def mime_in_header(header, mime):
- if not header in cherrypy.request.headers:
+ if header not in cherrypy.request.headers:
accepts = 'application/json'
else:
accepts = cherrypy.request.headers[header]
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index ed275d5..f3fd5da 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -57,7 +57,7 @@
from kimchi.vmtemplate import VMTemplate
-fake_user = { 'admin': 'letmein!' }
+fake_user = {'admin': 'letmein!'}
class MockModel(object):
@@ -583,8 +583,8 @@ def storageserver_lookup(self, server):
pool_info['source']['addr'] == server:
return dict(host=server)
except NotFoundError:
- # Avoid inconsistent pool result because
- # of lease between list and lookup
+ # Avoid inconsistent pool result because
+ # of lease between list and lookup
pass
raise NotFoundError("KCHSR0001E", {'server': server})
@@ -1257,13 +1257,13 @@ def getRepositories(self):
return self._repos.keys()
def getRepository(self, repo_id):
- if not repo_id in self._repos.keys():
+ if repo_id not in self._repos.keys():
raise NotFoundError("KCHREPOS0012E", {'repo_id': repo_id})
return self._repos[repo_id]
def enableRepository(self, repo_id):
- if not repo_id in self._repos.keys():
+ if repo_id not in self._repos.keys():
raise NotFoundError("KCHREPOS0012E", {'repo_id': repo_id})
info = self._repos[repo_id]
@@ -1276,7 +1276,7 @@ def enableRepository(self, repo_id):
return repo_id
def disableRepository(self, repo_id):
- if not repo_id in self._repos.keys():
+ if repo_id not in self._repos.keys():
raise NotFoundError("KCHREPOS0012E", {'repo_id': repo_id})
info = self._repos[repo_id]
@@ -1289,7 +1289,7 @@ def disableRepository(self, repo_id):
return repo_id
def updateRepository(self, repo_id, params):
- if not repo_id in self._repos.keys():
+ if repo_id not in self._repos.keys():
raise NotFoundError("KCHREPOS0012E", {'repo_id': repo_id})
info = self._repos[repo_id]
@@ -1299,7 +1299,7 @@ def updateRepository(self, repo_id, params):
return info['repo_id']
def removeRepository(self, repo_id):
- if not repo_id in self._repos.keys():
+ if repo_id not in self._repos.keys():
raise NotFoundError("KCHREPOS0012E", {'repo_id': repo_id})
del self._repos[repo_id]
@@ -1322,7 +1322,7 @@ def get_mock_environment():
vm = MockVM(vm_uuid, name, model.template_lookup('test-template-0'))
model._mock_vms[name] = vm
- #mock storagepool
+ # mock storagepool
for i in xrange(5):
name = 'default-pool-%i' % i
defaultstoragepool = MockStoragePool(name)
@@ -1343,7 +1343,7 @@ def get_mock_environment():
mockpool = model._mock_storagepools[name]
mockpool._volumes[vol_name] = defaultstoragevolume
- #mock network
+ # mock network
for i in xrange(5):
name = 'test-network-%i' % i
testnetwork = MockNetwork(name)
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index c699fc6..598fb26 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -248,7 +248,7 @@ def lookup(self, name):
path = xmlutils.xpath_get_text(xml, "/pool/target/path")[0]
pool_type = xmlutils.xpath_get_text(xml, "/pool/@type")[0]
source = self._get_storage_source(pool_type, xml)
- #FIXME: nfs workaround - prevent any libvirt operation
+ # FIXME: nfs workaround - prevent any libvirt operation
# for a nfs if the corresponding NFS server is down.
if pool_type == 'netfs' and not self._nfs_status_online(pool):
kimchi_log.debug("NFS pool %s is offline, reason: NFS "
@@ -328,7 +328,7 @@ def update(self, name, params):
def activate(self, name):
pool = self.get_storagepool(name, self.conn)
- #FIXME: nfs workaround - do not activate a NFS pool
+ # FIXME: nfs workaround - do not activate a NFS pool
# if the NFS server is not reachable.
xml = pool.XMLDesc(0)
pool_type = xmlutils.xpath_get_text(xml, "/pool/@type")[0]
@@ -359,7 +359,7 @@ def deactivate(self, name):
raise InvalidOperation('KCHPOOL0034E', {'name': name})
pool = self.get_storagepool(name, self.conn)
- #FIXME: nfs workaround - do not try to deactivate a NFS pool
+ # FIXME: nfs workaround - do not try to deactivate a NFS pool
# if the NFS server is not reachable.
xml = pool.XMLDesc(0)
pool_type = xmlutils.xpath_get_text(xml, "/pool/@type")[0]
diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
index c9ab1d4..41c840a 100644
--- a/src/kimchi/model/utils.py
+++ b/src/kimchi/model/utils.py
@@ -111,7 +111,8 @@ def set_metadata_node(dom, node, mode="all"):
KIMCHI_NAMESPACE, KIMCHI_META_URL,
flags=get_vm_config_flag(dom, mode))
else:
- # FIXME remove this code when all distro libvirt supports metadata element
+ # FIXME remove this code when all distro libvirt supports metadata
+ # element
_kimchi_set_metadata_node(dom, node)
@@ -123,7 +124,7 @@ def _kimchi_get_metadata_node(dom, tag):
xml = dom.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)
root = etree.fromstring(xml)
kimchi = root.find("metadata/{%s}kimchi" % KIMCHI_META_URL)
- #remove the "kimchi" prefix of xml
+ # remove the "kimchi" prefix of xml
# some developers may do not like to remove prefix by children iteration
# so here, use re to remove the "kimchi" prefix of xml
# and developers please don not define element like this:
@@ -142,7 +143,8 @@ def get_metadata_node(dom, tag, mode="current"):
if CapabilitiesModel().metadata_support:
kimchi = libvirt_get_kimchi_metadata_node(dom, mode)
else:
- # FIXME remove this code when all distro libvirt supports metadata element
+ # FIXME remove this code when all distro libvirt supports metadata
+ # element
kimchi = _kimchi_get_metadata_node(dom, tag)
if kimchi is not None:
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index cd985fa..a1bd754 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -67,8 +67,8 @@ def _get_storage_xml(params, ignore_source=False):
# Working with url paths
if src_type == 'network':
output = urlparse.urlparse(params.get('path'))
- host = E.host(name=output.hostname, port=
- output.port or socket.getservbyname(output.scheme))
+ port = output.port or socket.getservbyname(output.scheme)
+ host = E.host(name=output.hostname, port=port)
source = E.source(protocol=output.scheme, name=output.path)
source.append(host)
disk.append(source)
diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index 23e3ff0..5ea36f1 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -96,7 +96,7 @@ def getUpdate(self, name):
"""
Return a dictionary with all info from a given package name.
"""
- if not name in self._packages.keys():
+ if name not in self._packages.keys():
raise NotFoundError('KCHPKGUPD0002E', {'name': name})
return self._packages[name]
diff --git a/src/kimchi/template.py b/src/kimchi/template.py
index 0bee8c4..97103d3 100644
--- a/src/kimchi/template.py
+++ b/src/kimchi/template.py
@@ -62,7 +62,7 @@ def validate_language(langs):
def can_accept(mime):
- if not 'Accept' in cherrypy.request.headers:
+ if 'Accept' not in cherrypy.request.headers:
accepts = 'text/html'
else:
accepts = cherrypy.request.headers['Accept']
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index a992189..e48b377 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -109,6 +109,7 @@ def get_enabled_plugins():
except (TypeError, KeyError):
continue
+
def get_all_tabs():
files = [os.path.join(paths.prefix, 'config/ui/tabs.xml')]
diff --git a/tests/test_model.py b/tests/test_model.py
index cab8288..b77ba5b 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -337,7 +337,7 @@ def test_vm_cdrom(self):
self.assertEquals('', cdrom_info['path'])
inst.vm_poweroff(vm_name)
- # removing non existent cdrom
+ # removing non existent cdrom
self.assertRaises(NotFoundError, inst.vmstorage_delete, vm_name,
"fakedev")
@@ -1098,7 +1098,7 @@ def test_debug_reports(self):
report_list = inst.debugreports_get_list()
self.assertTrue(tmp_name in report_list)
except OperationFailed, e:
- if not 'debugreport tool not found' in e.message:
+ if 'debugreport tool not found' not in e.message:
raise e
def _wait_task(self, model, taskid, timeout=5):
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 4feb298..9266e01 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -46,7 +46,7 @@
ssl_port = None
cherrypy_port = None
-#utils.silence_server()
+# utils.silence_server()
def setUpModule():
@@ -175,8 +175,8 @@ def test_get_vms(self):
resp = self.request('/templates', req, 'POST')
self.assertEquals(201, resp.status)
- test_users = [ 'user1', 'user2', 'root']
- test_groups = [ 'group1', 'group2', 'admin' ]
+ test_users = ['user1', 'user2', 'root']
+ test_groups = ['group1', 'group2', 'admin']
# Now add a couple of VMs to the mock model
for i in xrange(10):
name = 'vm-%i' % i
@@ -696,21 +696,21 @@ def test_scsi_fc_storage(self):
self.assertEquals(201, resp.status)
# Test create vms using lun of this pool
- ### activate the storage pool
+ # activate the storage pool
resp = self.request('/storagepools/scsi_fc_pool/activate', '{}',
'POST')
- ### Get scsi pool luns and choose one
+ # Get scsi pool luns and choose one
resp = self.request('/storagepools/scsi_fc_pool/storagevolumes')
luns = json.loads(resp.read())
lun_name = random.choice(luns).get('name')
- ### Create vm in scsi pool without volumes: Error
+ # Create vm in scsi pool without volumes: Error
req = json.dumps({'template': '/templates/test_fc_pool'})
resp = self.request('/vms', req, 'POST')
self.assertEquals(400, resp.status)
- ### Create vm in scsi pool
+ # Create vm in scsi pool
req = json.dumps({'name': 'test-vm',
'template': '/templates/test_fc_pool',
'volumes': [lun_name]})
@@ -1651,7 +1651,7 @@ def test_create_debugreport(self):
self.assertEquals(200, resp.status)
req = json.dumps({'name': 'report2'})
resp = request(host, ssl_port, '/debugreports/report1',
- req, 'PUT')
+ req, 'PUT')
self.assertEquals(303, resp.status)
def test_debugreport_download(self):
diff --git a/tests/utils.py b/tests/utils.py
index f452854..0730b12 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -64,7 +64,7 @@ def assertIsInstance(self, obj, cls, msg=None):
self.fail('%s is not an instance of %r' % (repr(obj), cls))
def assertIn(self, a, b, msg=None):
- if not a in b:
+ if a not in b:
self.fail("%s is not in %b" % (repr(a), repr(b)))
def assertNotIn(self, a, b, msg=None):
@@ -154,7 +154,7 @@ def patch_auth(sudo=True):
"""
def _get_groups(self):
- return [ 'groupA', 'groupB', 'wheel' ]
+ return ['groupA', 'groupB', 'wheel']
def _has_sudo(self, result):
result.value = sudo
--
1.9.3
10 years, 4 months
[PATCH 0/2] VirtIO and vhost support in ppc64
by Rodrigo Trujillo
This patch set changes the RHEL and SLES versions that support virtio
in PPC64.
Also, it disable vhost feature for LE (PPC Little Endian) distros:
Ubuntu 14.04 and SLES 12
Rodrigo Trujillo (2):
Change modern distro versions for PPC
Disable vhost feature in Ubuntu and SLES (PPC64 LE)
src/kimchi/osinfo.py | 4 ++--
src/kimchi/vmtemplate.py | 19 +++++++++++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
--
1.9.3
10 years, 4 months