X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=vimconn.py;h=7ae33592c8917e63d0aadafc6558c442921be4f0;hb=392f28583d8750e7e2c2c5f2341688ec5acdf824;hp=6702c5f8edbd41a79cbffcc6adb9ea1cb49e6b58;hpb=7edb675ac76f3e0473042cf5cf7de3c0f19eda7d;p=osm%2FRO.git diff --git a/vimconn.py b/vimconn.py old mode 100755 new mode 100644 index 6702c5f8..7ae33592 --- a/vimconn.py +++ b/vimconn.py @@ -38,26 +38,31 @@ HTTP_Conflict = 409 HTTP_Service_Unavailable = 503 HTTP_Internal_Server_Error = 500 +class vimconnectorException(Exception): + pass class vimconnector(): '''Abstract base class for all the VIM connector plugins These plugins must implement a vimconnector class deribed from this and all these methods ''' - def __init__(self, uuid, name, tenant, url, url_admin=None, user=None, passwd=None,debug=True,config={}): + def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None,debug=True,config={}): self.id = uuid self.name = name self.url = url self.url_admin = url_admin - self.tenant = tenant + self.tenant_id = tenant_id + self.tenant_name = tenant_name self.user = user self.passwd = passwd self.config = config self.debug = debug def __getitem__(self,index): - if index=='tenant': - return self.tenant + if index=='tenant_id': + return self.tenant_id + if index=='tenant_name': + return self.tenant_name elif index=='id': return self.id elif index=='name': @@ -76,8 +81,10 @@ class vimconnector(): raise KeyError("Invalid key '%s'" %str(index)) def __setitem__(self,index, value): - if index=='tenant': - self.tenant = value + if index=='tenant_id': + self.tenant_id = value + if index=='tenant_name': + self.tenant_name = value elif index=='id': self.id = value elif index=='name':