On Sun, Dec 18, 2016 at 9:34 PM, Yaniv Kaul <yk...@redhat.com> wrote: > > > On Dec 18, 2016 8:39 PM, "Juan Hernández" <jhern...@redhat.com> wrote: > > On 12/18/2016 05:32 PM, Yaniv Kaul wrote: >> I'd expect, like other actions, add() for example, that I can ensure >> .remove() (for clusters, DCs, etc.) will return True as a sign for >> success. >> Is that a bug or a design choice? >> TIA, >> Y. >> > > It is by design. The method returns nothing, because in HTTP the DELETE > method doesn't receive or return a body: it only returns the HTTP status > code. In the SDK, success HTTP status code results in returning nothing, > and failures result in throwing an exception. So, if the methods doesn't > throw an exception then you can assume that it worked successfully. > > > So I should wrap it in try-except? And catch what?
Yes, it should catch the Error exception.  https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/lib/ovirtsdk4/__init__.py#L37 > TIA, > Y. > > > > > _______________________________________________ > Users mailing list > Users@ovirt.org > http://lists.ovirt.org/mailman/listinfo/users > _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users