SUSE / lrbd

GNU Lesser General Public License v2.1
24 stars 19 forks source link

Consider using rtslib directly instead of via targetcli #1

Closed agrover closed 8 years ago

agrover commented 8 years ago

Targetcli is a pretty face (command completion etc) on top of rtslib, which is an actual pythonic api to modify LIO's configuration. You may find that a considerable amount of output parsing and class wrappers in lrbd can be simplified by using rtslib directly.

You may wish to look at my targetd project, which uses an alternate rtslib than suse likely ships (rtslib-fb instead of rtslib) but its block.py is a similar example of combining lio configuration with something else, and using rtslib to minimize the extra code users must write to configure lio.

swiftgist commented 8 years ago

Hi Andy, Thanks for the tip. I realized targetcli was using rtslib at the time I started lrbd, but I had a little over a month to implement before a release. I was also learning Python as well and didn't want to overcommit.

I may switch to rtslib at some point, but lrbd doesn't actually parse any output from targetcli. I check the structures in /sys/kernel/config/target and only run the non-interactive targetcli commands. I will take a look at targetd though.