Closed agrover closed 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.
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 itsblock.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.