def callback_lsServer(mce):
        logging.debug('Received a New Service Profile Event: ' + str(mce.mo.classId))
        logging.debug("service-profile DN:%s association status:%s" % (mce.mo.getattr("Dn"), mce.mo.getattr(LsServer.ASSOC_STATE)))
        try:
                ucsmHost = UcsmHost(os.environ['UCS_HOSTNAME'], os.environ['UCS_USER'], os.environ['UCS_PASSWORD'], "", YesOrNo.FALSE)
        except Exception, err:
                logging.debug('EException' + str(err))
        pass

        # If the service-profile is removed/deleted, delete system from openstck cluster
        if (Status.DELETED == str(mce.mo.getattr(LsServer.STATUS))):
                try:
                        consumer = ServiceProfileConsumerFactory(os.environ['APP_NAME'])
                        consumer.removeHost(getRn(mce.mo.getattr("Dn")))
                except Exception, err:
                        logging.debug('6Exception: ' + str(err))
                pass
                logging.debug('Removed system')
        pass

        # if the association state is associated, then add the system to openstack cluster
        if (str(mce.mo.getattr(LsServer.ASSOC_STATE)) == LsServer.CONST_ASSOC_STATE_ASSOCIATED):
                try:
                        logging.debug('Creating ServiceProfileConsumerFactory for app-%s' % os.environ['APP_NAME'])
                        consumer = ServiceProfileConsumerFactory(os.environ['APP_NAME'])
                        logging.debug('ucsmHost-%s'% (ucsmHost.hostname))
                        consumer.updateHost(mce.mo.getattr("Dn"), ucsmHost)
                        logging.debug("Added System to - %s" % (os.environ['APP_NAME']) )
                except Exception, err:
                        logging.debug('7Exception: ' + str(err))
                pass
        pass
        logging.debug('end of event')
Event listener callback function. This checks for the event type and
dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/static-raw/scripts/SPConsumer.py/callback_lsServer