1 from kamaki.clients.compute import ComputeClient
2 from kamaki.clients.cyclades import CycladesClient
3 from kamaki.cli.config import Config
5 from snfOCCI.config import SERVER_CONFIG
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
12 class snfRegistry(registry.NonePersistentRegistry):
14 def add_resource(self, key, resource, extras):
16 key = resource.kind.location + resource.attributes['occi.core.id']
17 resource.identifier = key
19 super(snfRegistry, self).add_resource(key, resource, extras)
21 def set_hostname(self, hostname):
22 hostname = "https://" + SERVER_CONFIG['hostname'] + ":" + str(SERVER_CONFIG['port'])
23 super(snfRegistry, self).set_hostname(hostname)