<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 25, 2017 at 8:05 PM, Yaniv Kaul <span dir="ltr"><<a href="mailto:ykaul@redhat.com" target="_blank">ykaul@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Dec 25, 2017 at 5:55 PM, Juan Hernández <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_8575725240894296529gmail-HOEnZb"><div class="m_8575725240894296529gmail-h5">On 12/25/2017 04:21 PM, Yaniv Kaul wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm trying to check if a certain host can be upgraded.<br>
1. I'm calling it through the host_service, something like:<br>
<br>
host_service = connection.system_service().ho<wbr>sts_service().host_service(<br>
<a href="http://host.id" rel="noreferrer" target="_blank">host.id</a>)<br>
is_upgrade = host_service.upgrade_check()<br>
<br>
To my surprise, is_upgrade is None. I expected a Boolean.<br></blockquote></div></div></blockquote></span></div></div></div></blockquote><div><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">Replied in the bug below, "check-for-upgrade" operation needs to be asynchronous, the only way we could do is to check underlying "check-for-upgrade" job status until completed and afterwards check if updates are availavle directly on the host (and that AFAIK cannot be done automatically inside SDK as SDKs are automatically generated from API).</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_8575725240894296529gmail-HOEnZb"><div class="m_8575725240894296529gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. In addition, when trying to upgrade via:<br>
host_service.upgrade()<br>
<br>
I'm getting Operation Failed - and it complains there are no upgrades<br>
available.<br>
Alas, in the UI it shows that upgrades available and upgrade does work<br>
through the UI.<br></blockquote></div></div></blockquote></span></div></div></div></blockquote><div><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">So that seems like a bug, because we have a boolean flag inside database if upgrade is available so there should not be any difference between UI and API</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_8575725240894296529gmail-HOEnZb"><div class="m_8575725240894296529gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Am I misusing the functions?<br>
(The host is a regular host, not ovirt-node btw).<br>
<br>
TIA,<br>
Y.<br>
<br>
</blockquote>
<br></div></div>
The "upgrade_check" method doesn't return anything, it just triggers the execution of the process to check for upgrades. Then only result will be that an icon will be displayed in the UI.<br>
<br>
That isn't very useful, to be honest, so I'd suggest to open a bug to modify this so that the upgrade runs synchronously, and so that the method returns the boolean that you expected.<br></blockquote><div><br></div></span><div>Filed <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1528999" target="_blank">https://bugzilla.redhat.<wbr>com/show_bug.cgi?id=1528999</a> and now looking into the 2nd issue.</div><span class="HOEnZb"><font color="#888888"><div>Y.</div><div> </div></font></span></div><br></div></div>
<br>______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/devel</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font size="1">Martin Perina<br>Associate Manager, Software Engineering<br>Red Hat Czech s.r.o.<br></font></div></div>
</div></div>