# Path: opsmgr/inventory/plugins.py
# class PluginApplication():
# 
#     def __init__(self, name, function, protocol, host, port, path):
#         self.name = name
#         self.function = function
#         self.protocol = protocol
#         self.host = host
#         self.port = port
#         self.path = path
# 
#     def get_name(self):
#         return self.name
# 
#     def get_function(self):
#         return self.function
# 
#     def get_protocol(self):
#         return self.protocol
# 
#     def get_host(self):
#         return self.host
# 
#     def get_port(self):
#         return self.port
# 
#     def get_path(self):
#         return self.path
# 
#     @staticmethod
#     @entry_exit(exclude_index=[], exclude_name=[])
#     def get_operations_plugins():
#         """ Returns a List of PluginApplication classes so the url for an installed application
#             can be constructed. For plugins installed on the localhost, it is recommened to not use
#             the host field here, but use the host or ip the user specified in the url.
#         """
#         plugin_apps = []
#         plugins = PluginApplication._load_operations_plugins()
#         for _plugin_name, plugin_class in plugins.items():
#             plugin_app = plugin_class.get_application_url()
#             if plugin_app is not None:
#                 plugin_apps.append(plugin_app)
#         return plugin_apps
# 
#     @staticmethod
#     @entry_exit(exclude_index=[], exclude_name=[])
#     def get_plugins_status():
#         """ Returns two list of Strings for critical and warning messages from
#             all plugins on the localhost.
#         """
#         critical_messages = []
#         warning_messages = []
#         plugins = PluginApplication._load_operations_plugins()
#         for _plugin_name, plugin_class in plugins.items():
#             (crit, warn) = plugin_class.get_status()
#             if crit is not None:
#                 critical_messages.extend(crit)
#             if warn is not None:
#                 warning_messages.extend(warn)
#         return (critical_messages, warning_messages)
# 
#     @staticmethod
#     def _load_operations_plugins():
#         """
#         Find the operations plugins and return them as a
#         dictonary[name]=plugin class
#         """
#         return load_plugin_by_namespace(I_OPERATIONS_PLUGINS)


from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import tabs
from operational_mgmt.inventory import tables
from operational_mgmt import rack
from operational_mgmt import resource
from opsmgr.inventory.plugins import PluginApplication
import logging
import opsmgr.inventory.rack_mgr as rack_mgr
import opsmgr.inventory.resource_mgr as resource_mgr
        if len(result_dict['racks']) > 0:
            the_rack = rack.Rack(result_dict['racks'][0])
            counter = 0
            rack_meta_data.append(RackProperty(counter, "Label",
                                               the_rack.name))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Data Center",
                                               the_rack.data_center))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Room",
                                               the_rack.room))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Row",
                                               the_rack.row))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Notes",
                                               the_rack.notes))

    return rack_meta_data


def retrieve_application_links(self, request):
    __method__ = 'tabs.retrieve_application_links'
    app_link_data = {}

    # Retrieve the applications' link information

# Path: opsmgr/inventory/plugins.py
# class PluginApplication():
# 
#     def __init__(self, name, function, protocol, host, port, path):
#         self.name = name
#         self.function = function
#         self.protocol = protocol
#         self.host = host
#         self.port = port
#         self.path = path
# 
#     def get_name(self):
#         return self.name
# 
#     def get_function(self):
#         return self.function
# 
#     def get_protocol(self):
#         return self.protocol
# 
#     def get_host(self):
#         return self.host
# 
#     def get_port(self):
#         return self.port
# 
#     def get_path(self):
#         return self.path
# 
#     @staticmethod
#     @entry_exit(exclude_index=[], exclude_name=[])
#     def get_operations_plugins():
#         """ Returns a List of PluginApplication classes so the url for an installed application
#             can be constructed. For plugins installed on the localhost, it is recommened to not use
#             the host field here, but use the host or ip the user specified in the url.
#         """
#         plugin_apps = []
#         plugins = PluginApplication._load_operations_plugins()
#         for _plugin_name, plugin_class in plugins.items():
#             plugin_app = plugin_class.get_application_url()
#             if plugin_app is not None:
#                 plugin_apps.append(plugin_app)
#         return plugin_apps
# 
#     @staticmethod
#     @entry_exit(exclude_index=[], exclude_name=[])
#     def get_plugins_status():
#         """ Returns two list of Strings for critical and warning messages from
#             all plugins on the localhost.
#         """
#         critical_messages = []
#         warning_messages = []
#         plugins = PluginApplication._load_operations_plugins()
#         for _plugin_name, plugin_class in plugins.items():
#             (crit, warn) = plugin_class.get_status()
#             if crit is not None:
#                 critical_messages.extend(crit)
#             if warn is not None:
#                 warning_messages.extend(warn)
#         return (critical_messages, warning_messages)
# 
#     @staticmethod
#     def _load_operations_plugins():
#         """
#         Find the operations plugins and return them as a
#         dictonary[name]=plugin class
#         """
#         return load_plugin_by_namespace(I_OPERATIONS_PLUGINS)


# Path: horizon/operational_mgmt/inventory/tabs.py
from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import tabs
from operational_mgmt.inventory import tables
from operational_mgmt import rack
from operational_mgmt import resource
from opsmgr.inventory.plugins import PluginApplication
import logging
import opsmgr.inventory.rack_mgr as rack_mgr
import opsmgr.inventory.resource_mgr as resource_mgr

        if len(result_dict['racks']) > 0:
            the_rack = rack.Rack(result_dict['racks'][0])
            counter = 0
            rack_meta_data.append(RackProperty(counter, "Label",
                                               the_rack.name))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Data Center",
                                               the_rack.data_center))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Room",
                                               the_rack.room))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Row",
                                               the_rack.row))

            counter += 1
            rack_meta_data.append(RackProperty(counter, "Notes",
                                               the_rack.notes))

    return rack_meta_data


def retrieve_application_links(self, request):
    __method__ = 'tabs.retrieve_application_links'
    app_link_data = {}

    # Retrieve the applications' link information

    applications = PluginApplication.get_operations_plugins()