Пример #1
0
    def _get_operation_caller(self):
        #try import nodes manager caller
        try:
            from blik.nodesManager.dbusClient import DBUSInterfaceClient
            client = DBUSInterfaceClient()

            return client
        except ImportError, err:
            logger.warning('Boot manager require nodes manager for automatic changing hostname.')

            return None
Пример #2
0
    def _import_plugins():
        work_dir = plugins.__path__[0]
        dirs = os.listdir(work_dir)

        ret_map = plugins.OPERATIONS_PLUGINS
        for item in dirs:
            item_path = os.path.join(work_dir, item)

            if not os.path.isdir(item_path):
                continue

            try:
                exec('from blik.nodeAgent.plugins.%s import OPERATIONS_PLUGINS'%item)

                ret_map.update(OPERATIONS_PLUGINS)
            except ImportError, err:
                logger.warning('Can not import %s module. Details: %s'%(item_path,err))