Red Hat Bugzilla – Bug 1303715
[ovirt-shell] download_ca_certificate() should handle url without /ovirt-engine/api
Last modified: 2016-05-10 06:30:06 EDT
Description of problem:
if user has:
$ grep url .ovirtshellrc
url = https://jb-rhevm36.rhev.lab.eng.brq.redhat.com
re.sub won't match. just a proposal, maybe urlparse is better.
--- /usr/local/lib/python2.7/site-packages/ovirtcli/platform/posix/spice.py.orig Mon Feb 1 18:55:39 2016
+++ /usr/local/lib/python2.7/site-packages/ovirtcli/platform/posix/spice.py Mon Feb 1 18:56:12 2016
@@ -156,7 +156,7 @@ def launch_remote_viewer(cmd, host, host_subject, port
"""Downloads the CA certificate from the engine."""
- ca_url = re.sub("^https?://([^/]+)/.*", "http://\\1/ca.crt", url)
+ ca_url = re.sub("^https?://([^/]+)(/.*)?", "http://\\1/ca.crt", url)
ca_file = None
ca_fd, ca_file = tempfile.mkstemp()
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. put url without /ovirt-engine/api
2. console $vm
failure, ca_file would be html page of $url and not ca file
should work as we can't be sure user knows he should put /ovirt-engine/api
Sounds more like a RFE to me than a bug, no?
There are no plans to update the CLI, so this won't be fixed.