X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Faggregate_manager_max.py;h=efdb06db3a883bb17388630a996c82da3903a0a3;hb=6e7a01f3ecde9663f1989313242848a8efb5f3ab;hp=ff6ea73bbfcf350279b38534c988a31b10dc2f83;hpb=ee8a376da1107884bee1ea29248a70e4da8410c9;p=sfa.git diff --git a/sfa/managers/aggregate_manager_max.py b/sfa/managers/aggregate_manager_max.py index ff6ea73b..efdb06db 100644 --- a/sfa/managers/aggregate_manager_max.py +++ b/sfa/managers/aggregate_manager_max.py @@ -1,20 +1,26 @@ -from sfa.plc.slices import Slices -from sfa.server.registry import Registries -from sfa.util.xrn import urn_to_hrn, hrn_to_urn, get_authority, Xrn -from sfa.util.plxrn import hrn_to_pl_slicename -from sfa.util.sfalogging import logger +import os +import time +import re + from sfa.util.faults import * +from sfa.util.sfalogging import logger from sfa.util.config import Config from sfa.util.sfatime import utcparse from sfa.util.callids import Callids from sfa.util.version import version_core +from sfa.util.xrn import urn_to_hrn, hrn_to_urn, get_authority, Xrn +from sfa.util.plxrn import hrn_to_pl_slicename + +from sfa.server.sfaapi import SfaApi +from sfa.server.registry import Registries from sfa.rspecs.rspec_version import RSpecVersion from sfa.rspecs.sfa_rspec import sfa_rspec_version from sfa.rspecs.rspec_parser import parse_rspec -from sfa.managers.aggregate_manager_pl import __get_registry_objects, ListSlices -import os -import time -import re + +from sfa.managers.aggregate_manager import _get_registry_objects, ListSlices + +from sfa.plc.slices import Slices + RSPEC_TMP_FILE_PREFIX = "/tmp/max_rspec" @@ -80,7 +86,7 @@ def get_xml_by_tag(text, tag): return xml def prepare_slice(api, slice_xrn, creds, users): - reg_objects = __get_registry_objects(slice_xrn, creds, users) + reg_objects = _get_registry_objects(slice_xrn, creds, users) (hrn, type) = urn_to_hrn(slice_xrn) slices = Slices(api) peer = slices.get_peer(hrn) @@ -251,14 +257,14 @@ def ListResources(api, creds, options,call_id): slice_urn = options.get('geni_slice_urn') return get_rspec(api, creds, slice_urn) -""" -Returns the request context required by sfatables. At some point, this mechanism should be changed -to refer to "contexts", which is the information that sfatables is requesting. But for now, we just -return the basic information needed in a dict. -""" def fetch_context(slice_hrn, user_hrn, contexts): + """ + Returns the request context required by sfatables. At some point, this mechanism should be changed + to refer to "contexts", which is the information that sfatables is requesting. But for now, we just + return the basic information needed in a dict. + """ base_context = {'sfa':{'user':{'hrn':user_hrn}}} return base_context - api = PlcSfaApi() + api = SfaApi() create_slice(api, "plc.maxpl.test000", None, rspec_xml, None)