gdeploy icon indicating copy to clipboard operation
gdeploy copied to clipboard

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

Open ShyamsundarR opened this issue 9 years ago • 5 comments

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.

ShyamsundarR avatar Dec 07 '16 20:12 ShyamsundarR

Ack! I will fix this.

sac avatar Dec 08 '16 12:12 sac

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 avatar Dec 08 '16 12:12 sac

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,

  • If the conf just has pvs listed, then the vgs, lvs do not get cleaned up

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.

ShyamsundarR avatar Dec 12 '16 17:12 ShyamsundarR

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

sac avatar Dec 13 '16 11:12 sac

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

devyanikota avatar Feb 05 '18 13:02 devyanikota