-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the correct XML attribute to indicate volume status #44
Conversation
@jhernand was this indeed fixed in 3.4.1 that it can be no longer reproduced? |
The status of any object (not just volumes) is potentially something like this:
For most objects we don't currently populate the The current code in rbovirt, if I understand it correctly, is assuming that I'd suggest to modify all places where status is handled so that the code explicitly gets the value of the first @abonas I'm afraid I didn't explain correctly. When I say that there are potentially multiple values I mean that there are multiple (up to two) elements inside |
@jhernand, very detailed info, thanks, indeed I misunderstood when you wrote before regarding a "list of pairs containg state and description". what doesn't make sense to me is that it's mentioned above it stopped reproducing. |
@abonas Back when the issue was first discovered (one month ago) we were already using RHEV 3.4.1 (no software updates have happened on our environment recently). I don't know what has changed in our setup that could have 'resolved' the issue.. Anyway, I guess that the statement @status = ((xml/'status').first.text rescue nil) shouldn't be used anyway and only the status/state field should be used. If desired I can update this PR for that |
@jhernand your opinion? should this patch be altered to take care of it, or do it separately for all relevant entities/how many entities are handled incorrectly? |
I agree with the latest suggestion from @epienbroek, keep only the following line:
I just tested this, with latest 3.6, and it works correctly. Without that, as I explained before, the whitespace used for pretty printing is included in the result. There wasn't any change in this area in oVirt as far as I know, this worked like this for a long time. @epienbroek, maybe the behaviour of the Ruby @abonas I'd suggest to use this PR to fix this known issue with volumes, and others if the issue exists in other places. |
I see the same issue in the following source files:
In
|
Thanks for the research, I'll update this PR with an updated commit soon |
@jhernand , @epienbroek the plan sounds good to me :) |
Potentially all entities have a |
@abonas I just checked, but the REST API at https://RHEV_SERVER/api/clusters (which should be used by rbovirt's lib/ovirt/cluster.rb) doesn't contain a status element so I'm not sure that catching the status element from rbovirt's baseobject will work for all situations |
@epienbroek, @jhernand is the oVirt REST maintainer, so I'd like to hear his opinion how to handle it, he knows all the entities really well :) |
In the oVirt server all objects, including clusters, may have a |
I think the right way to do it is to handle it generically in base obj. Having said that, it doesn't have to be part of this patch. What should be part of this patch is correct handling of the status in volume - for which this patch was originally opened for. |
301d351
to
37c5e3f
Compare
This PR has just been updated with a new commit. |
Looks good to me, I'd merge it if I had permissions. |
@jhernand you are now collaborator! |
Thanks @abenari, I'm merging this pull request then. |
Use the correct XML attribute to indicate volume status
Thanks for the approval! |
Guys I am running rbovirt integration tests against oVirt 3.4 and 3.5 on RHEL6 and RHEL7. In case it fails, I will comment on particular PRs. I cannot do beforehand tests tho, only after it's merged. I am not there yet... |
I mean - it runs automatically every night. |
No description provided.