Open ShyamsundarR opened 7 years ago
Ack! I will fix this.
Shyam, somehow when I test this now works in my environment. The literal_eval works as expected self.validated_params('pvs') returns a list something like '['/dev/sda', '/dev/sdb']' which is a string and will be converted to list by literal_eval. I tested with my setup seem to work with the same configuration file you had.
Did you have a mounted filesystem?
sac, I did not have a mounted system, I guess I am reporting 2 issues, or rather debugged the first issue to possibly the literal_eval above. So, let me rephrase my problem,
IOW, a conf as follows, does not remove the required groups and volumes. [hosts] 127.0.0.5
[backend-reset:127.0.0.5] pvs=sdb,sdc,sdd
I will retest once more, but in case you are able to reproduce the above, and also let me know how to go about debugging this, it would be helpful.
Shyam, I tested the exact setup you have stated above again. It works fine with me. What is the error you see on console?
@ShyamsundarR hello. Is this issue still reproducible? Please confirm the same. Thanks.
This line in the code, https://github.com/gluster/gdeploy/blob/master/modules/backend_reset.py#L35 "self.pvs = literal_eval(self.validated_params('pvs'))"
Seems to actually throw an exception and hence it enters the except block and marks self.pvs as None. Hence, none of the pvs are really removed. IOW, comma separated string to dict as passed to literal_eval does not seem to do the trick, and I do not know enough python to suggest alternatives.
Additionally, if a YAML input just had pvs in it, this function does nothing, due to the above bug (possibly).
To reproduce, just have this in the YAML [hosts] 127.0.0.5
This resets the backend setup specified
[backend-reset:127.0.0.5] pvs=sdb,sdc,sdd
and execute gdeploy -c
The end result is that none of the pvs,lvs,vgs are removed.
If I add a vgs to the above that is valid and exists, then that (and its downward depdendencis lvs etc.) is removed successfully.