#!/usr/bin/python
# -*- coding: utf-8 -*-

# replacment for the shell command "opsi-admin -d -S method getDepotIds_list"

#from OPSI.Backend.Backend import *
from OPSI.Backend.BackendManager import BackendManager

#from OPSI.Backend.JSONRPC import JSONRPCBackend
#from OPSI.Logger import *
#from OPSI.Product import *
#from OPSI import Tools
#from OPSI.UI import *

#bm = BackendManager(authRequired = False, configFile = '/etc/opsi/backendManager.d')
bm = BackendManager(
                                dispatchConfigFile = u'/etc/opsi/backendManager/dispatch.conf',
                                backendConfigDir   = u'/etc/opsi/backends',
                                extensionConfigDir = u'/etc/opsi/backendManager/extend.d',
                                depotBackend       = False,
                                hostControlBackend = True
                        )
depotIds = bm.getDepotIds_list()
for i in range(len(depotIds)):
    print "depots[%i]=%s" % (i, depotIds[i])
