Ich möchte gerne von meiner lokalen Maschine, meine OPSI-Server per Python ansprechen.
Das Paket python-opsi habe ich installiert, Die Klasse BackendManager fragt allerdings nach einer dispatch.conf, die natürlich auf dem entfernten Configserver liegt.
Hat jemand einen Ansatz, wie ich den BackendManager instanzieren muss, damit ich remote arbeiten kann?
Code: Alles auswählen
from OPSI.Backend import BackendManager
bm = BackendManager.BackendManager() #Parameter für den Remoteserver?
bm.getClientIds_list()
Code: Alles auswählen
Traceback (most recent call last):
File "test.py", line 2, in <module>
bm = BackendManager.BackendManager()
File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 227, in __init__
self._backend = BackendDispatcher(context=self, **kwargs)
File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 324, in __init__
self.__loadDispatchConfig()
File "/usr/lib/python2.7/dist-packages/OPSI/Backend/BackendManager.py", line 356, in __loadDispatchConfig
raise BackendConfigurationError(u"Dispatch config file '%s' not found" % self._dispatchConfigFile)
OPSI.Exceptions.BackendConfigurationError: <BackendConfigurationError(u"Dispatch config file '/etc/opsi/backendManager/dispatch.conf' not found")>