Re: [ovirt-devel] upgrade_check and upgrade API calls (v4)

2017-12-26 Thread Martin Perina
On Mon, Dec 25, 2017 at 8:05 PM, Yaniv Kaul  wrote:

>
>
> On Mon, Dec 25, 2017 at 5:55 PM, Juan Hernández 
> wrote:
>
>> On 12/25/2017 04:21 PM, Yaniv Kaul wrote:
>>
>>> I'm trying to check if a certain host can be upgraded.
>>> 1. I'm calling it through the host_service, something like:
>>>
>>> host_service = connection.system_service().hosts_service().host_service(
>>> host.id)
>>> is_upgrade = host_service.upgrade_check()
>>>
>>> To my surprise, is_upgrade is None. I expected a Boolean.
>>>
>>
​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).


>>> 2. In addition, when trying to upgrade via:
>>> host_service.upgrade()
>>>
>>> I'm getting Operation Failed - and it complains there are no upgrades
>>> available.
>>> Alas, in the UI it shows that upgrades available and upgrade does work
>>> through the UI.
>>>
>>
​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
​

>
>>> Am I misusing the functions?
>>> (The host is a regular host, not ovirt-node btw).
>>>
>>> TIA,
>>> Y.
>>>
>>>
>> 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.
>>
>> 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.
>>
>
> Filed https://bugzilla.redhat.com/show_bug.cgi?id=1528999 and now looking
> into the 2nd issue.
> Y.
>
>
>
> ___
> Devel mailing list
> Devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
>



-- 
Martin Perina
Associate Manager, Software Engineering
Red Hat Czech s.r.o.
___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] upgrade_check and upgrade API calls (v4)

2017-12-25 Thread Juan Hernández

On 12/25/2017 04:21 PM, Yaniv Kaul wrote:

I'm trying to check if a certain host can be upgraded.
1. I'm calling it through the host_service, something like:

host_service = connection.system_service().hosts_service().host_service(
host.id)
is_upgrade = host_service.upgrade_check()

To my surprise, is_upgrade is None. I expected a Boolean.

2. In addition, when trying to upgrade via:
host_service.upgrade()

I'm getting Operation Failed - and it complains there are no upgrades
available.
Alas, in the UI it shows that upgrades available and upgrade does work
through the UI.

Am I misusing the functions?
(The host is a regular host, not ovirt-node btw).

TIA,
Y.



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.


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.

___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel


[ovirt-devel] upgrade_check and upgrade API calls (v4)

2017-12-25 Thread Yaniv Kaul
I'm trying to check if a certain host can be upgraded.
1. I'm calling it through the host_service, something like:

host_service = connection.system_service().hosts_service().host_service(
host.id)
is_upgrade = host_service.upgrade_check()

To my surprise, is_upgrade is None. I expected a Boolean.

2. In addition, when trying to upgrade via:
host_service.upgrade()

I'm getting Operation Failed - and it complains there are no upgrades
available.
Alas, in the UI it shows that upgrades available and upgrade does work
through the UI.

Am I misusing the functions?
(The host is a regular host, not ovirt-node btw).

TIA,
Y.
___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel