[libvirt] [PATCH libvirt-python v2 00/22] event-test.py fixes

Philipp Hahn posted 22 patches 6 years, 2 months ago
Failed in applying to current master (apply log)
examples/event-test.py | 446 +++++++++++++++++++++++++++++--------------------
1 file changed, 262 insertions(+), 184 deletions(-)
[libvirt] [PATCH libvirt-python v2 00/22] event-test.py fixes
Posted by Philipp Hahn 6 years, 2 months ago
Am 21.09.18 um 13:14 schrieb Michal Privoznik:
> On 09/20/2018 08:10 AM, Philipp Hahn wrote:
>> event-test.py is bad at handling newer livecycle events.
>> Attached are two patches to improve that.
>>
>> Philipp Hahn (2):
>>   event-test.py: Sync list of domain lifecycle events
>>   event-test.py: Future proof lifecycle event handling
>>
>>  examples/event-test.py | 18 ++++++++++++------
>>  1 file changed, 12 insertions(+), 6 deletions(-)
>
> ACK to the first patch, no doubt about that. However, the second one -
> I'm torn. One one hand it makes the code more future proof, on the other
> - seeing a traceback (which is easy to spot) might inspire users to post
> patches (because we are obviously not doing a good job in keeping
> event-test.py in sync with libvirt). What do you think?

Yes, I can understand it, but each time I use event-test.py (spaced months
apart) I get the next crash. So I really would like it to be more future poof.
If the number is annoying enough, any interested user is free so send a patch
to improve it.

As the pattern of printing some details is quiet common in that script, I did a
v2 and added a somehow hacky class 'Description' to simplify writing those
descriptive texts. Please have a look at the following series as an alternative.

I also found some other issues I fixed along the way.

Philipp Hahn (22):
  event-test.py: Handle closed connection
  event-test.py: Remove extra parenthesis
  event-test.py: Remove dead assignment
  event-test.py: Add missing globale statement
  event-test.py: Use __file__
  event-test.py: Merge livecycle callbacks
  event-test.py: Simplify event ID lists
  event-test.py: Add class for event descriptions
  event-test.py: Convert LIVECYCLE events
  event-test.py: Convert BLOCKJOB events
  event-test.py: Convert WATCHDOG events
  event-test.py: Convert ERROR events
  event-test.py: Convert AGENT events
  event-test.py: Convert GRAPHICS events
  event-test.py: Convert DISK events
  event-test.py: Convert TRAY events
  event-test.py: Convert NETWORK events
  event-test.py: Convert STORAGE events
  event-test.py: Convert DEVICE events
  event-test.py: Convert SECRET events
  event-test.py: Convert CONNECTION events
  event-test.py: Fix blanks

 examples/event-test.py | 446 +++++++++++++++++++++++++++++--------------------
 1 file changed, 262 insertions(+), 184 deletions(-)

-- 
2.11.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH libvirt-python v2 00/22] event-test.py fixes
Posted by Michal Privoznik 6 years, 2 months ago
On 09/21/2018 03:34 PM, Philipp Hahn wrote:
> Am 21.09.18 um 13:14 schrieb Michal Privoznik:
>> On 09/20/2018 08:10 AM, Philipp Hahn wrote:
>>> event-test.py is bad at handling newer livecycle events.
>>> Attached are two patches to improve that.
>>>
>>> Philipp Hahn (2):
>>>   event-test.py: Sync list of domain lifecycle events
>>>   event-test.py: Future proof lifecycle event handling
>>>
>>>  examples/event-test.py | 18 ++++++++++++------
>>>  1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> ACK to the first patch, no doubt about that. However, the second one -
>> I'm torn. One one hand it makes the code more future proof, on the other
>> - seeing a traceback (which is easy to spot) might inspire users to post
>> patches (because we are obviously not doing a good job in keeping
>> event-test.py in sync with libvirt). What do you think?
> 
> Yes, I can understand it, but each time I use event-test.py (spaced months
> apart) I get the next crash. So I really would like it to be more future poof.
> If the number is annoying enough, any interested user is free so send a patch
> to improve it.
> 
> As the pattern of printing some details is quiet common in that script, I did a
> v2 and added a somehow hacky class 'Description' to simplify writing those
> descriptive texts. Please have a look at the following series as an alternative.
> 
> I also found some other issues I fixed along the way.
> 
> Philipp Hahn (22):
>   event-test.py: Handle closed connection
>   event-test.py: Remove extra parenthesis
>   event-test.py: Remove dead assignment
>   event-test.py: Add missing globale statement
>   event-test.py: Use __file__
>   event-test.py: Merge livecycle callbacks
>   event-test.py: Simplify event ID lists
>   event-test.py: Add class for event descriptions
>   event-test.py: Convert LIVECYCLE events
>   event-test.py: Convert BLOCKJOB events
>   event-test.py: Convert WATCHDOG events
>   event-test.py: Convert ERROR events
>   event-test.py: Convert AGENT events
>   event-test.py: Convert GRAPHICS events
>   event-test.py: Convert DISK events
>   event-test.py: Convert TRAY events
>   event-test.py: Convert NETWORK events
>   event-test.py: Convert STORAGE events
>   event-test.py: Convert DEVICE events
>   event-test.py: Convert SECRET events
>   event-test.py: Convert CONNECTION events
>   event-test.py: Fix blanks
> 
>  examples/event-test.py | 446 +++++++++++++++++++++++++++++--------------------
>  1 file changed, 262 insertions(+), 184 deletions(-)
> 

Yup, this looks very good. So I'll merge 1/2 from the original v1 and
all 22 patches from this v2.

ACK

Thanks,
Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list