Bug 1303715 - [ovirt-shell] download_ca_certificate() should handle url without /ovirt-engine/api
Summary: [ovirt-shell] download_ca_certificate() should handle url without /ovirt-engi...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-engine-cli
Classification: oVirt
Component: Core
Version: 3.6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-01 18:00 UTC by Jiri Belka
Modified: 2022-06-30 13:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 10:30:06 UTC
oVirt Team: Infra
Embargoed:
sbonazzo: ovirt-4.1-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-46846 0 None None None 2022-06-30 13:01:45 UTC

Description Jiri Belka 2016-02-01 18:00:15 UTC
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
 def download_ca_certificate(url):
     """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
     try:
         ca_fd, ca_file = tempfile.mkstemp()


Version-Release number of selected component (if applicable):
3.6.2.1

How reproducible:
100%

Steps to Reproduce:
1. put url without /ovirt-engine/api
2. console $vm
3.

Actual results:
failure, ca_file would be html page of $url and not ca file

Expected results:
should work as we can't be sure user knows he should put /ovirt-engine/api

Additional info:

Comment 1 Yaniv Kaul 2016-03-13 16:00:21 UTC
Sounds more like a RFE to me than a bug, no?

Comment 2 Juan Hernández 2016-05-10 10:30:06 UTC
There are no plans to update the CLI, so this won't be fixed.


Note You need to log in before you can comment on or make changes to this bug.