Bug 1195624

Summary: Rhevm-shell does not support DNS aliasses
Product: Red Hat Enterprise Virtualization Manager Reporter: Roman Hodain <rhodain>
Component: ovirt-engine-cliAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.0CC: ecohen, gklein, iheim, lsurette, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-24 08:52:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roman Hodain 2015-02-24 08:24:23 UTC
Description of problem:
When an alias from /etc/hosts file is used shell is not able to connect to the API

Version-Release number of selected component (if applicable):
rhevm-cli-3.5.0.5-1.el6ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. set a new alias for RHEV-M
2. try to connect via this alias

Actual results:
Alias="rhevm35"
"https://rhevm35:443/ovirt-engine/api" is invalid url format, valid format is http[s]://server:port/path, where path is usually "ovirt-engine/api" or, for older versions of the engine, just "api".


Expected results:
The system either allow to use the alias or it provide more information about the URL format

Additional info:
The shell expect FQDN so rhevm35.example.com works.

from the code:

src/ovirtcli/command/connect.py:

    def is_valid_url(self, url):
        if url is None:
            return False;
        #self.error(url)
        regex = re.compile(
            r'^(?:http)s?://'  # http:// or https://
            r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
            r'localhost|'  # localhost...
            r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|'  # ...or ipv4
            r'\[?[A-F0-9]*:[A-F0-9:]+\]?)'  # ...or ipv6
            r'(?::\d+)?'  # optional port
           , re.IGNORECASE)
        if not regex.search(url):
            return False

Comment 1 Juan Hernández 2015-02-24 08:52:45 UTC

*** This bug has been marked as a duplicate of bug 1186365 ***