from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
from sfa.util.rspec import *
from sfa.util.specdict import *
from sfa.util.faults import *
filename = ".".join([self.api.interface, self.api.hrn, "nodes"])
filepath = path + os.sep + filename
self.nodes_file = filepath
SimpleStorage.__init__(self, self.nodes_file)
self.policy = Policy(api)
self.load()
filename = ".".join([self.api.interface, self.api.hrn, "nodes"])
filepath = path + os.sep + filename
self.nodes_file = filepath
SimpleStorage.__init__(self, self.nodes_file)
self.policy = Policy(api)
self.load()
- def get_remote_resources(self, hrn = None):
+ def get_rspec_smgr(self, xrn = None):
+ hrn, type = urn_to_hrn(xrn)
# convert and threshold to ints
if self.has_key('timestamp') and self['timestamp']:
hr_timestamp = self['timestamp']
# convert and threshold to ints
if self.has_key('timestamp') and self['timestamp']:
hr_timestamp = self['timestamp']
# extract the netspec from each aggregates rspec
rspec.parseString(agg_rspec)
networks.extend([{'NetSpec': rspec.getDictsByTagName('NetSpec')}])
except:
# XX print out to some error log
# extract the netspec from each aggregates rspec
rspec.parseString(agg_rspec)
networks.extend([{'NetSpec': rspec.getDictsByTagName('NetSpec')}])
except:
# XX print out to some error log
- exc_type, exc_value, exc_traceback = sys.exc_info()
- raise exc_type, exc_value
+ print >> log, "%s" % (traceback.format_exc())
# filter according to policy
blist = self.policy['node_blacklist']
wlist = self.policy['node_whitelist']
# filter according to policy
blist = self.policy['node_blacklist']
wlist = self.policy['node_whitelist']
- return self.get_rspec_aggregate(hrn)
-
- def get_rspec_smgr(self, hrn = None):
-
- rspec = self.get_remote_resources(hrn)
- return rspec.toxml()
+ return self.get_rspec_aggregate(xrn)
# Filter out whitelisted nodes
public_nodes = lambda n: n.has_key('slice_ids_whitelist') and not n['slice_ids_whitelist']
# Filter out whitelisted nodes
public_nodes = lambda n: n.has_key('slice_ids_whitelist') and not n['slice_ids_whitelist']
elif self.api.plshell_version in ['4.3']:
interfaces = self.api.plshell.GetInterfaces(self.api.plauth, interface_ids)
else:
elif self.api.plshell_version in ['4.3']:
interfaces = self.api.plshell.GetInterfaces(self.api.plauth, interface_ids)
else:
resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
# convert the plc dict to an rspec dict
resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
# convert the plc dict to an rspec dict