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()
# 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()
- print exc_type, exc_value, exc_traceback
+ print >> log, "%s" % (traceback.format_exc())
def get_rspec_aggregate(self, hrn = None):
"""
Get resource information from PLC
"""
def get_rspec_aggregate(self, hrn = None):
"""
Get resource information from PLC
"""
# 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