Michael Pasternak has posted comments on this change.

Change subject: cli: unclear error message when logging into cli with bad 
formatted url
......................................................................


Patch Set 2: Code-Review-1

(3 comments)

....................................................
File src/ovirtcli/command/connect.py
Line 149:             self.__remove_history_entry()
Line 150: 
Line 151:     def is_valid_url(self, url):
Line 152:         if url is None:
Line 153:             return false;
false != python boolean False
Line 154:         regex = re.compile(
Line 155:             r'^(?:http)s?://' # http:// or https://
Line 156:             
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'
 # domain...
Line 157:             r'localhost|' # localhost...


Line 160:             r'(?::\d+)?' # optional port
Line 161:             r'(/api)' # /api
Line 162:            , re.IGNORECASE)
Line 163:         if not regex.search(url):
Line 164:             return false
same
Line 165:         hostname = self.get_hostname(url)
Line 166:         if not self.hostname_is_ip(hostname):
Line 167:             return true
Line 168:         return self.is_valid_ip(hostname)


Line 163:         if not regex.search(url):
Line 164:             return false
Line 165:         hostname = self.get_hostname(url)
Line 166:         if not self.hostname_is_ip(hostname):
Line 167:             return true
true != python boolean True
Line 168:         return self.is_valid_ip(hostname)
Line 169: 
Line 170:     def get_hostname(self, url):
Line 171:         url_obj = urlparse(url)


-- 
To view, visit http://gerrit.ovirt.org/18621
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib3665d8714258ad8e449638fbf0b86105f813e3e
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to