def get_plugin_filters(context, plugin): # Return filters for the neutron list apis so that only resources from # a specific plugin will be returned. filters = {} core_plugin = nsxadmin.get_plugin() if core_plugin == 'nsxtvd': maps = db.get_project_plugin_mappings_by_plugin( context.session, plugin) if maps: filters['project_id'] = [m.project for m in maps] return filters
def main(argv=sys.argv[1:]): _init_cfg() nsx_plugin_in_use = resources.get_plugin() resources.init_resource_plugin( nsx_plugin_in_use, resources.get_plugin_dir(nsx_plugin_in_use)) LOG.info('NSX Plugin in use: %s', nsx_plugin_in_use) _validate_resource_choice(cfg.CONF.resource, nsx_plugin_in_use) _validate_op_choice(cfg.CONF.operation, nsx_plugin_in_use) registry.notify(cfg.CONF.resource, cfg.CONF.operation, 'nsxadmin', force=cfg.CONF.force, property=cfg.CONF.property, verbose=cfg.CONF.verbose)
def main(argv=sys.argv[1:]): _init_cfg() nsx_plugin_in_use = resources.get_plugin() LOG.info('NSX Plugin in use: %s', nsx_plugin_in_use) # the user can select the specific plugin selected_plugin = _validate_plugin_choice(cfg.CONF.plugin, nsx_plugin_in_use) resources.init_resource_plugin( selected_plugin, resources.get_plugin_dir(selected_plugin)) _validate_resource_choice(cfg.CONF.resource, selected_plugin) _validate_op_choice(cfg.CONF.operation, selected_plugin) registry.notify(cfg.CONF.resource, cfg.CONF.operation, 'nsxadmin', force=cfg.CONF.force, property=cfg.CONF.property, verbose=cfg.CONF.verbose)