<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 13, 2016 at 11:13 AM, Juan Hernández <span dir="ltr">&lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/13/2016 12:04 AM, Yaniv Kaul wrote:<br>
&gt; On Fri, Oct 7, 2016 at 10:44 PM, Yaniv Kaul &lt;<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a><br>
</span><div><div class="h5">&gt; &lt;mailto:<a href="mailto:ykaul@redhat.com">ykaul@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I&#39;m trying on FC24, using<br>
&gt;     python-ovirt-engine-sdk4-4.1.<wbr>0-0.0.20161003git056315d.fc24.<wbr>x86_64 to<br>
&gt;     add a DC, and failing - against master. The client is unhappy:<br>
&gt;     File<br>
&gt;     &quot;/home/ykaul/ovirt-system-<wbr>tests/basic-suite-master/test-<wbr>scenarios/002_bootstrap.py&quot;,<br>
&gt;     line 98, in add_dc4<br>
&gt;         version=sdk4.types.Version(<wbr>major=DC_VER_MAJ,minor=DC_VER_<wbr>MIN),<br>
&gt;       File &quot;/usr/lib64/python2.7/site-<wbr>packages/ovirtsdk4/services.<wbr>py&quot;,<br>
&gt;     line 4347, in add<br>
&gt;         response = self._connection.send(request)<br>
&gt;       File &quot;/usr/lib64/python2.7/site-<wbr>packages/ovirtsdk4/__init__.<wbr>py&quot;,<br>
&gt;     line 276, in send<br>
&gt;         return self.__send(request)<br>
&gt;       File &quot;/usr/lib64/python2.7/site-<wbr>packages/ovirtsdk4/__init__.<wbr>py&quot;,<br>
&gt;     line 298, in __send<br>
&gt;         self._sso_token = self._get_access_token()<br>
&gt;       File &quot;/usr/lib64/python2.7/site-<wbr>packages/ovirtsdk4/__init__.<wbr>py&quot;,<br>
&gt;     line 460, in _get_access_token<br>
&gt;         sso_response = self._get_sso_response(self._<wbr>sso_url, post_data)<br>
&gt;       File &quot;/usr/lib64/python2.7/site-<wbr>packages/ovirtsdk4/__init__.<wbr>py&quot;,<br>
&gt;     line 498, in _get_sso_response<br>
&gt;         return json.loads(body_buf.getvalue()<wbr>.decode(&#39;utf-8&#39;))<br>
&gt;       File &quot;/usr/lib64/python2.7/json/__<wbr>init__.py&quot;, line 339, in loads<br>
&gt;         return _default_decoder.decode(s)<br>
&gt;       File &quot;/usr/lib64/python2.7/json/<wbr>decoder.py&quot;, line 364, in decode<br>
&gt;         obj, end = self.raw_decode(s, idx=_w(s, 0).end())<br>
&gt;       File &quot;/usr/lib64/python2.7/json/<wbr>decoder.py&quot;, line 382, in raw_decode<br>
&gt;         raise ValueError(&quot;No JSON object could be decoded&quot;)<br>
&gt;     ValueError: No JSON object could be decoded<br>
&gt;<br>
&gt;<br>
&gt;     Surprisingly, I now can&#39;t find that RPM of this SDK in<br>
</div></div>&gt;     <a href="http://resources.ovirt.org" rel="noreferrer" target="_blank">resources.ovirt.org</a> &lt;<a href="http://resources.ovirt.org" rel="noreferrer" target="_blank">http://resources.ovirt.org</a>&gt; now.<br>
<div><div class="h5">&gt;<br>
&gt;     I&#39;ve tried<br>
&gt;     with <a href="http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/fc24/x86_64/python-ovirt-engine-sdk4-4.0.0-0.1.20161004gitf94eeb5.fc24.x86_64.rpm" rel="noreferrer" target="_blank">http://resources.ovirt.org/<wbr>pub/ovirt-master-snapshot/rpm/<wbr>fc24/x86_64/python-ovirt-<wbr>engine-sdk4-4.0.0-0.1.<wbr>20161004gitf94eeb5.fc24.x86_<wbr>64.rpm</a><br>
&gt;     &lt;<a href="http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/fc24/x86_64/python-ovirt-engine-sdk4-4.0.0-0.1.20161004gitf94eeb5.fc24.x86_64.rpm" rel="noreferrer" target="_blank">http://resources.ovirt.org/<wbr>pub/ovirt-master-snapshot/rpm/<wbr>fc24/x86_64/python-ovirt-<wbr>engine-sdk4-4.0.0-0.1.<wbr>20161004gitf94eeb5.fc24.x86_<wbr>64.rpm</a>&gt;<br>
&gt;<br>
&gt;     - same result.<br>
&gt;<br>
&gt;     Did not see anything obvious on server or engine logs.<br>
&gt;     The code:<br>
&gt;     def add_dc4(api):<br>
&gt;         nt.assert_true(api != None)<br>
&gt;         dcs_service = api.system_service().data_<wbr>centers_service()<br>
&gt;         nt.assert_true(<br>
&gt;             dc = dcs_service.add(<br>
&gt;                 sdk4.types.DataCenter(<br>
&gt;                     name=DC_NAME4,<br>
&gt;                     description=&#39;APIv4 DC&#39;,<br>
&gt;                     local=False,<br>
&gt;<br>
&gt;     version=sdk4.types.Version(<wbr>major=DC_VER_MAJ,minor=DC_VER_<wbr>MIN),<br>
&gt;                 ),<br>
&gt;             )<br>
&gt;         )<br>
&gt;<br>
&gt;<br>
&gt;     And the api object is from:<br>
&gt;                 return sdk4.Connection(<br>
&gt;                     url=url,<br>
&gt;                     username=constants.ENGINE_<wbr>USER,<br>
&gt;                     password=str(self.metadata[&#39;<wbr>ovirt-engine-password&#39;]),<br>
&gt;                     insecure=True,<br>
&gt;                     debug=True,<br>
&gt;                 )<br>
&gt;<br>
&gt;<br>
&gt; The clue is actually on the HTTPd logs:<br>
&gt; 192.168.203.1 - - [12/Oct/2016:17:56:27 -0400] &quot;POST<br>
&gt; /ovirt-engine/sso/oauth/token HTTP/1.1&quot; 404 74<br>
&gt;<br>
&gt; And indeed, from the deubg log:<br>
&gt; begin captured logging &lt;&lt; --------------------\n<br>
&gt; root: DEBUG: Trying 192.168.203.3...\n<br>
&gt; root: DEBUG: Connected to 192.168.203.3 (192.168.203.3) port 443 (#0)\n<br>
&gt; root: DEBUG: Initializing NSS with certpath: sql:/etc/pki/nssdb\n<br>
&gt; root: DEBUG: skipping SSL peer certificate verification\n<br>
&gt; root: DEBUG: ALPN/NPN, server did not agree to a protocol\n<br>
&gt; root: DEBUG: SSL connection using TLS_ECDHE_RSA_WITH_AES_128_<wbr>GCM_SHA256\n<br>
&gt; root: DEBUG: Server certificate:\n<br>
&gt; root: DEBUG: subject: CN=engine,O=Test,C=US\n<br>
&gt; root: DEBUG: start date: Oct 11 21:55:29 2016 GMT\n<br>
&gt; root: DEBUG: expire date: Sep 16 21:55:29 2021 GMT\n<br>
&gt; root: DEBUG: common name: engine\nroot: DEBUG: issuer:<br>
&gt; CN=engine.38998,O=Test,C=US\n<br>
</div></div>&gt; *root: DEBUG: POST /ovirt-engine/sso/oauth/token HTTP/1.1\n*<br>
&gt; *root: DEBUG: Host: 192.168.203.3\n*<br>
&gt; *root: DEBUG: User-Agent: PythonSDK/4.1.0a0\n*<br>
&gt; *root: DEBUG: Accept: application/json\n*<br>
&gt; *root: DEBUG: Content-Length: 78\n*<br>
&gt; *root: DEBUG: Content-Type: application/x-www-form-<wbr>urlencoded\nroot:<br>
&gt; DEBUG:<br>
&gt; username=admin%40internal&amp;<wbr>scope=ovirt-app-api&amp;password=<wbr>123&amp;grant_type=password\n*<br>
&gt; *root: DEBUG: upload completely sent off: 78 out of 78 bytes\n*<br>
&gt; *root: DEBUG: HTTP/1.1 404 Not Found\n*<br>
&gt; *root: DEBUG: Date: Wed, 12 Oct 2016 21:56:27 GMT\n*<br>
&gt; *root: DEBUG: Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips\n*<br>
&gt; *root: DEBUG: Content-Length: 74\n*<br>
&gt; *root: DEBUG: Content-Type: text/html; charset=UTF-8\n*<br>
&gt; *root: DEBUG: \n*<br>
&gt; *root: DEBUG: &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/<wbr>title&gt;&lt;/head&gt;&lt;body&gt;404 - Not<br>
&gt; Found&lt;/body&gt;&lt;/html&gt;\n*<br>
<span class="">&gt; root: DEBUG: Connection #0 to host 192.168.203.3 left intact\n<br>
&gt; --------------------- &gt;&gt; end captured logging<br>
&gt;<br>
<br>
</span>That definitively looks like version 3 of the engine. Either that or<br>
version 4 of the engine with web server configuration modified so that<br>
the SSO doesn&#39;t work as expected.<br>
<br>
What do you get if you run this against that server?<br></blockquote><div><br></div><div>Attached.</div><div>Y.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
  curl \<br>
  --verbose \<br>
  --insecure \<br>
  --request GET \<br>
  --user &quot;admin@internal:yourpassword&quot; \<br>
  --header &quot;Version: 4&quot; \<br>
  --header &quot;Accept: application/xml&quot; \<br>
  &quot;<a href="https://thatserver/ovirt-engine/api" rel="noreferrer" target="_blank">https://thatserver/ovirt-<wbr>engine/api</a>&quot;<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta<br>
3ºD, 28016 Madrid, Spain<br>
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.<br>
</div></div></blockquote></div><br></div></div>