gluster / gdeploy

gdeploy - an Ansible based tool to deploy GlusterFS
GNU General Public License v3.0
91 stars 69 forks source link

backend reset does not function as expected, possibly due to incorrect parsing #247

Open ShyamsundarR opened 7 years ago

ShyamsundarR commented 7 years ago

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.

sac commented 7 years ago

Ack! I will fix this.

sac commented 7 years ago

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?

ShyamsundarR commented 7 years ago

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.

sac commented 7 years ago

Shyam, I tested the exact setup you have stated above again. It works fine with me. What is the error you see on console?

devyanikota commented 6 years ago

@ShyamsundarR hello. Is this issue still reproducible? Please confirm the same. Thanks.