Juan Hernandez has uploaded a new change for review.

Change subject: cli: Don't require /api
......................................................................

cli: Don't require /api

Currently we perform an explicit validation of the URL of the API, and
this requires that the path component of the URL is exactly /api. This
doesn't work with the new URL schema of the engine, and won't work
either if the user decides use any other base URL. This patch removes
the validation of the path.

Change-Id: I71fac959498d17e1176ea16584e5b4d2c36ddbf4
Bug-Url: https://bugzilla.redhat.com/1069171
Signed-off-by: Juan Hernandez <[email protected]>
(cherry picked from commit 95314e74e4699b7c828f88c27d01ceaf1bc416ed)
---
M src/cli/messages.py
M src/ovirtcli/command/connect.py
M src/ovirtcli/infrastructure/options.py
3 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/62/24962/1

diff --git a/src/cli/messages.py b/src/cli/messages.py
index c4d0f9a..eadaea3 100644
--- a/src/cli/messages.py
+++ b/src/cli/messages.py
@@ -52,7 +52,7 @@
         INVALID_KWARGS_FORMAT = '"%s" is invalid --kwargs argument, valid 
format is "x=y;z=q;...".'
         INVALID_KWARGS_CONTENT = '--kwargs constraint cannot be empty.'
         INVALID_ARGUMENT_TYPE = 'value used for the \"%s\" is \"%s\", while %s'
-        INVALID_URL_SEGMENT = '"%s" is invalid url format. valid format is 
http[s]://server:port/api.'
+        INVALID_URL_SEGMENT = '"%s" 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".'
         MISSING_CONFIGURATION_VARIABLE = 'missing configuration variable: %s.'
         UNSUPPORTED_ATTRIBUTE = 'object construction failure, this could 
happen if you using unsupported option, please see help for the given command 
for more details.'
     class Warning():
diff --git a/src/ovirtcli/command/connect.py b/src/ovirtcli/command/connect.py
index e4ead52..08d1e2a 100644
--- a/src/ovirtcli/command/connect.py
+++ b/src/ovirtcli/command/connect.py
@@ -51,7 +51,7 @@
 
         == Arguments ==
 
-         * url               - The URL to connect to 
(http[s]://server[:port]/api).
+         * url               - The URL to connect to 
(http[s]://server[:port]/ovirt-engine/api).
          * username          - The user to connect as. (user@domain).
          * password          - The password to use.
          * [key-file]        - The client PEM key file to use.
@@ -188,7 +188,6 @@
             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
-            r'(/api)'  # /api
            , re.IGNORECASE)
         if not regex.search(url):
             return False
diff --git a/src/ovirtcli/infrastructure/options.py 
b/src/ovirtcli/infrastructure/options.py
index 8aded8d..17a2770 100644
--- a/src/ovirtcli/infrastructure/options.py
+++ b/src/ovirtcli/infrastructure/options.py
@@ -35,7 +35,7 @@
         self.add_option('-d', '--debug', action='store_true',
                         help='enable debugging')
         self.add_option('-l', '--url',
-                        help='specifies the API entry point URL 
(http[s]://server[:port]/api)')
+                        help='specifies the API entry point URL 
(http[s]://server[:port]/ovirt-engine/api)')
         self.add_option('-u', '--username', help='connect as this user')
         self.add_option('-K', '--key-file', help='specify client PEM key-file')
         self.add_option('-C', '--cert-file', help='specify client PEM 
cert-file')


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71fac959498d17e1176ea16584e5b4d2c36ddbf4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: cli_3.4
Gerrit-Owner: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to