INNER CODE UNIT · Python
linstor_api
LINBIT/linstor-server · scripts/linstor-controller-ha-setup.py:157
def linstor_api():
"""A connected python-linstor client for the controller on this node.
The library is imported here and not at the top: preflight() may still have
to install linstor-client (which brings python-linstor with it), so at
import time it is not necessarily there yet.
The controller is always local -- the script only runs where it is active --
and only until move_db() stops it, which is why every call has to happen
before that.
"""
if not _linstor_conn:
# preflight() may have installed linstor-client moments ago. Python
# caches the directory listing of every sys.path entry, so a package
# that appeared after this interpreter started is not necessarily
# visible to import without this.
importlib.invalidate_caches()
try: