X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fdatabase.py;fp=osm_mon%2Fcore%2Fdatabase.py;h=77c5bc326d6bd926241d2ea7702f78f6b2fa3ae5;hb=dcfe2522f51578edc68156bd823c9bc3607e746b;hp=0886c2bf0bcf9693f5ee12d8a1a8c64cc836d1a8;hpb=616fde7e4671be3da07ea59765c311c26bfe2e16;p=osm%2FMON.git diff --git a/osm_mon/core/database.py b/osm_mon/core/database.py index 0886c2b..77c5bc3 100644 --- a/osm_mon/core/database.py +++ b/osm_mon/core/database.py @@ -25,6 +25,7 @@ import logging import os import uuid +import json from peewee import CharField, TextField, FloatField, Model, AutoField, Proxy from peewee_migrate import Router @@ -126,5 +127,11 @@ class DatabaseManager: def get_vim_type(self, vim_account_id) -> str: """Get the vim type that is required by the message.""" + vim_type = None credentials = self.get_credentials(vim_account_id) - return str(credentials.type) + config = json.loads(credentials.config) + if 'vim_type' in config: + vim_type = config['vim_type'] + return str(vim_type.lower()) + else: + return str(credentials.type)