X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fmessage_bus%2Fcommon_consumer.py;h=0ba003b8c967835c1bade1ab886a48b947bbe146;hb=ad1d76c5afc49644f7d864eee85d8e4d09a184cc;hp=e79e98adc5c3dbdbe48595fdde0ce9a3650e438d;hpb=181cce8e28a9b6c5c6fa1fa8aa515de3b187a2e1;p=osm%2FMON.git diff --git a/osm_mon/core/message_bus/common_consumer.py b/osm_mon/core/message_bus/common_consumer.py index e79e98a..0ba003b 100755 --- a/osm_mon/core/message_bus/common_consumer.py +++ b/osm_mon/core/message_bus/common_consumer.py @@ -77,10 +77,12 @@ aws_access_credentials = AccessCredentials() vrops_rcvr = plugin_receiver.PluginReceiver() -def get_vim_type(message): +def get_vim_type(msg): """Get the vim type that is required by the message.""" try: - return json.loads(message.value)["vim_type"].lower() + vim_uuid = json.loads(msg.value)["vim_uuid"].lower() + credentials = database_manager.get_credentials(vim_uuid) + return credentials.type except Exception as exc: log.warn("vim_type is not configured correctly; %s", exc) return None