No need to go through all that. Just wrap the O-ring around a rack leg twice. Like this:

Works on the outside of the rack leg...

...or on the inside of the leg to clear your panniers.

Battery pack velcros to a rack crossmember and rests on the fender.