X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Faggregate_manager_eucalyptus.py;h=7b50d2a27eadb290ffc4305efef4728789d1e745;hb=dbce495b6f2e7d8dccbfb18c5507907d784c143b;hp=9b9703803214ec0106521a3308ae5314c6bdb612;hpb=b94bb59dbb4b448992f6b1b7a84dfbbc7ce365ed;p=sfa.git diff --git a/sfa/managers/aggregate_manager_eucalyptus.py b/sfa/managers/aggregate_manager_eucalyptus.py index 9b970380..7b50d2a2 100644 --- a/sfa/managers/aggregate_manager_eucalyptus.py +++ b/sfa/managers/aggregate_manager_eucalyptus.py @@ -1,9 +1,7 @@ from __future__ import with_statement -from sfa.util.faults import * -from sfa.util.namespace import * -from sfa.util.rspec import RSpec -from sfa.server.registry import Registries -from sfa.plc.nodes import * + +import sys +import os import boto from boto.ec2.regioninfo import RegionInfo @@ -13,8 +11,10 @@ from xmlbuilder import XMLBuilder from lxml import etree as ET from sqlobject import * -import sys -import os +from sfa.util.faults import * +from sfa.util.namespace import urn_to_hrn +from sfa.util.rspec import RSpec +from sfa.server.registry import Registries ## # The data structure used to represent a cloud. @@ -334,9 +334,17 @@ class ZoneResultParser(object): return clusterList -def get_rspec(api, xrn, origin_hrn): +def get_rspec(api, creds, options): global cloud - hrn = urn_to_hrn(xrn)[0] + # get slice's hrn from options + xrn = options.get('geni_slice_urn', None) + hrn, type = urn_to_hrn(xrn) + + # get hrn of the original caller + origin_hrn = options.get('origin_hrn', None) + if not origin_hrn: + origin_hrn = Credential(string=creds[0]).get_gid_caller().get_hrn() + conn = getEucaConnection() if not conn: @@ -415,7 +423,7 @@ def get_rspec(api, xrn, origin_hrn): """ Hook called via 'sfi.py create' """ -def create_slice(api, xrn, xml): +def create_slice(api, xrn, creds, xml, users): global cloud hrn = urn_to_hrn(xrn)[0]