features for voms authentication
[snf-occi] / snfOCCI / registry.py
1 from kamaki.clients.compute import ComputeClient
2 from kamaki.clients.cyclades import CycladesClient
3 from kamaki.cli.config  import Config
4
5 from snfOCCI.config import SERVER_CONFIG
6
7 from occi import registry
8 from occi.core_model import Mixin
9 from occi.backend import MixinBackend
10 from occi.extensions.infrastructure import RESOURCE_TEMPLATE, OS_TEMPLATE
11
12 class snfRegistry(registry.NonePersistentRegistry):
13
14     def add_resource(self, key, resource, extras):
15
16         key = resource.kind.location + resource.attributes['occi.core.id']
17         resource.identifier = key
18
19         super(snfRegistry, self).add_resource(key, resource, extras)
20
21     def set_hostname(self, hostname):
22         hostname = "https://" + SERVER_CONFIG['hostname'] + ":" + str(SERVER_CONFIG['port']) 
23         super(snfRegistry, self).set_hostname(hostname)