git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a missing part of the call_id on ListResources/get_rspec
[sfa.git]
/
sfa
/
managers
/
aggregate_manager_max.py
diff --git
a/sfa/managers/aggregate_manager_max.py
b/sfa/managers/aggregate_manager_max.py
index
d7aed8e
..
0b37bb3
100644
(file)
--- a/
sfa/managers/aggregate_manager_max.py
+++ b/
sfa/managers/aggregate_manager_max.py
@@
-1,20
+1,23
@@
#!/usr/bin/python
#!/usr/bin/python
-from sfa.util.rspec import RSpec
import sys
import pdb
import sys
import pdb
-from sfa.util.namespace import *
+import xml.dom.minidom
+
+from sfa.util.rspec import RSpec
+from sfa.util.xrn import urn_to_hrn, hrn_to_urn, get_authority
+from sfa.util.plxrn import hrn_to_pl_slicename
+from sfa.util.plxrn import hrn_to_pl_slicename
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.storage import *
from sfa.util.policy import Policy
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.storage import *
from sfa.util.policy import Policy
-from sfa.util.debug import log
from sfa.server.aggregate import Aggregates
from sfa.server.registry import Registries
from sfa.util.faults import *
from sfa.server.aggregate import Aggregates
from sfa.server.registry import Registries
from sfa.util.faults import *
+from sfa.util.callids import Callids
-import xml.dom.minidom
SFA_MAX_CONF_FILE = '/etc/sfa/max_allocations'
SFA_MAX_DEFAULT_RSPEC = '/etc/sfa/max_physical.xml'
SFA_MAX_CONF_FILE = '/etc/sfa/max_allocations'
SFA_MAX_DEFAULT_RSPEC = '/etc/sfa/max_physical.xml'
@@
-147,7
+150,8
@@
def create_slice_max_aggregate(api, hrn, nodes):
registries = Registries(api)
registry = registries[api.hrn]
credential = api.getCredential()
registries = Registries(api)
registry = registries[api.hrn]
credential = api.getCredential()
- records = registry.resolve(credential, hrn)
+ urn = hrn_to_urn(hrn, 'slice')
+ records = registry.Resolve(urn, credential)
for record in records:
if record.get_type() in ['slice']:
slice = record.as_dict()
for record in records:
if record.get_type() in ['slice']:
slice = record.as_dict()
@@
-164,7
+168,8
@@
def create_slice_max_aggregate(api, hrn, nodes):
sites = api.plshell.GetSites(api.plauth, [login_base])
if not sites:
authority = get_authority(hrn)
sites = api.plshell.GetSites(api.plauth, [login_base])
if not sites:
authority = get_authority(hrn)
- site_records = registry.resolve(credential, authority)
+ authority_urn = hrn_to_urn(authority, 'authority')
+ site_records = registry.Resolve(authority_urn, credential)
site_record = {}
if not site_records:
raise RecordNotFound(authority)
site_record = {}
if not site_records:
raise RecordNotFound(authority)
@@
-193,7
+198,8
@@
def create_slice_max_aggregate(api, hrn, nodes):
researchers = record.get('researcher', [])
for researcher in researchers:
person_record = {}
researchers = record.get('researcher', [])
for researcher in researchers:
person_record = {}
- person_records = registry.resolve(credential, researcher)
+ researcher_urn = hrn_to_urn(researcher, 'user')
+ person_records = registry.Resolve(researcher_urn, credential)
for record in person_records:
if record.get_type() in ['user']:
person_record = record
for record in person_records:
if record.get_type() in ['user']:
person_record = record
@@
-248,9
+254,10
@@
def create_slice_max_aggregate(api, hrn, nodes):
return 1
return 1
-def get_rspec(api, creds, options):
+def get_rspec(api, creds, options, call_id):
+ if not Callids().should_handle_call_id(call_id): return ""
# get slice's hrn from options
# get slice's hrn from options
- xrn = options.get('geni_slice_urn',
None
)
+ xrn = options.get('geni_slice_urn',
''
)
hrn, type = urn_to_hrn(xrn)
# Eg. config line:
# plc.princeton.sapan vlan23,vlan45
hrn, type = urn_to_hrn(xrn)
# Eg. config line:
# plc.princeton.sapan vlan23,vlan45