blob: b93c0235d048269d62914f0ddb630d025e749a5a [file] [log] [blame]
Yunpeng Zhangd01f3ce2017-07-06 20:06:35 -04001# from services.vbbu.models import *
2from synchronizers.new_base.modelaccessor import *
Pingping Lind28ab982016-08-29 18:42:52 +00003from xosresource import XOSResource
4
Yunpeng Zhangd01f3ce2017-07-06 20:06:35 -04005class XOSVBBUTenant(XOSResource):
6 provides = "tosca.nodes.VBBUTenant"
7 xos_model = VBBUTenant
Pingping Lind28ab982016-08-29 18:42:52 +00008 copyin_props = ["s1u_tag", "s1mme_tag", "rru_tag", "display_message"]
9 name_field = None
10
11 def get_xos_args(self, throw_exception=True):
Yunpeng Zhangd01f3ce2017-07-06 20:06:35 -040012 args = super(XOSVBBUTenant, self).get_xos_args()
Pingping Lind28ab982016-08-29 18:42:52 +000013
14 provider_name = self.get_requirement("tosca.relationships.MemberOfService", throw_exception=throw_exception)
15 if provider_name:
16 args["provider_service"] = self.get_xos_object(MCORDService, throw_exception=throw_exception, name=provider_name)
17
18 return args
19
20 def get_existing_objs(self):
21 args = self.get_xos_args(throw_exception=False)
22 provider_service = args.get("provider", None)
23 if provider_service:
24 return [ self.get_xos_object(provider_service=provider_service) ]
25 return []
26
27 def postprocess(self, obj):
28 pass
29
30 def can_delete(self, obj):
Yunpeng Zhangd01f3ce2017-07-06 20:06:35 -040031 return super(XOSVBBUTenant, self).can_delete(obj)
Pingping Lind28ab982016-08-29 18:42:52 +000032