# -*- encoding: utf-8 -*- # Software Management Providers # # Copyright (C) 2012 Red Hat, Inc. All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Authors: Michal Minar # """ Entry module for OpenLMI Software proviers. """ from openlmi.common import cmpi_logging from openlmi.software.LMI_SoftwareIdentity import LMI_SoftwareIdentity from openlmi.software.LMI_SystemSoftwareCollection import \ LMI_SystemSoftwareCollection from openlmi.software.LMI_HostedSoftwareCollection import \ LMI_HostedSoftwareCollection from openlmi.software.LMI_MemberOfSoftwareCollection import \ LMI_MemberOfSoftwareCollection from openlmi.software.LMI_InstalledSoftwareIdentity import \ LMI_InstalledSoftwareIdentity from openlmi.software.yumdb import YumDB def get_providers(env): """ @return mapping of provider names to corresponding provider instances. """ cmpi_logging.LogManager(env) providers = { "LMI_SoftwareIdentity" : LMI_SoftwareIdentity(env), "LMI_SystemSoftwareCollection" : LMI_SystemSoftwareCollection(env), "LMI_HostedSoftwareCollection" : LMI_HostedSoftwareCollection(env), "LMI_MemberOfSoftwareCollection" : LMI_MemberOfSoftwareCollection(env), "LMI_InstalledSoftwareIdentity" : LMI_InstalledSoftwareIdentity(env) } return providers def can_unload(_env): """ Says, whether providers can be unlouded. """ return True def shutdown(_env): """ Release resources upon cleanup. """ YumDB.get_instance().clean_up()