projects
/
osm
/
MON.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added VIO metrics collector for vROPs
[osm/MON.git]
/
osm_mon
/
core
/
database.py
diff --git
a/osm_mon/core/database.py
b/osm_mon/core/database.py
index
0886c2b
..
77c5bc3
100644
(file)
--- a/
osm_mon/core/database.py
+++ b/
osm_mon/core/database.py
@@
-25,6
+25,7
@@
import logging
import os
import uuid
import logging
import os
import uuid
+import json
from peewee import CharField, TextField, FloatField, Model, AutoField, Proxy
from peewee_migrate import Router
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."""
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)
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)