Fix a test in suse repo detection

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=274
This commit is contained in:
Charles Arnold 2015-10-06 21:34:53 +00:00 committed by Git OBS Bridge
parent 4debc691ca
commit 65063f38e2

View File

@ -1,7 +1,7 @@
Enhancement that gets the hosts installation location from
install.inf and also collects the repos provided by zypper.
These locations are then presented as potential installation
locations when createing a VM.
locations when creating a VM.
Index: virt-manager-1.2.1/virtManager/create.py
===================================================================
--- virt-manager-1.2.1.orig/virtManager/create.py
@ -40,7 +40,7 @@ Index: virt-manager-1.2.1/virtinst/util.py
def listify(l):
@@ -462,3 +465,96 @@ def register_libvirt_error_handler():
@@ -462,3 +465,97 @@ def register_libvirt_error_handler():
ignore = userdata
ignore = err
libvirt.registerErrorHandler(f=libvirt_callback, ctx=None)
@ -62,8 +62,9 @@ Index: virt-manager-1.2.1/virtinst/util.py
+ if line.startswith('RepoURL:'):
+ repo_url = line[:-1].split('?', 1)[0]
+ repo_url = repo_url.split(' ')
+ if repo_url[1]:
+ if repo_url[1].startswith('ftp:') or repo_url[1].startswith('http:') or repo_url[1].startswith('smb:') or repo_url[1].startswith('nfs:'):
+ if len(repo_url) > 1:
+ if repo_url[1].startswith('ftp:') or repo_url[1].startswith('http:') or \
+ repo_url[1].startswith('smb:') or repo_url[1].startswith('nfs:'):
+ _host_repo_url = repo_url[1]
+ return repo_url[1]
+ return None