Scott Baker | 8e6647a | 2016-06-20 17:16:20 -0700 | [diff] [blame] | 1 | import os |
| 2 | import pdb |
| 3 | import sys |
| 4 | import tempfile |
| 5 | sys.path.append("/opt/tosca") |
| 6 | from translator.toscalib.tosca_template import ToscaTemplate |
| 7 | import pdb |
| 8 | |
| 9 | from core.models import User, TenantRootPrivilege, TenantRootRole |
| 10 | from services.volt.models import CordSubscriberRoot |
| 11 | |
| 12 | from xosresource import XOSResource |
| 13 | |
| 14 | class XOSCORDSubscriber(XOSResource): |
| 15 | provides = "tosca.nodes.CORDSubscriber" |
| 16 | xos_model = CordSubscriberRoot |
| 17 | copyin_props = ["service_specific_id", "firewall_enable", "url_filter_enable", "cdn_enable", "url_filter_level"] |
| 18 | |
| 19 | def postprocess(self, obj): |
| 20 | rolemap = ( ("tosca.relationships.AdminPrivilege", "admin"), ("tosca.relationships.AccessPrivilege", "access"), ) |
| 21 | self.postprocess_privileges(TenantRootRole, TenantRootPrivilege, rolemap, obj, "tenant_root") |
| 22 | |
| 23 | def can_delete(self, obj): |
| 24 | return super(XOSCORDSubscriber, self).can_delete(obj) |
| 25 | |