from datetime import datetime, timedelta
from sfa.util.xrn import *
from sfa.util.plxrn import hostname_to_urn
-from sfa.util.config import Config
from sfa.util.faults import SfaNotImplemented, InvalidRSpec
class RSpec:
header = '<?xml version="1.0"?>\n'
template = """<RSpec></RSpec>"""
- config = Config()
xml = None
type = None
version = None
# 'rspec' file doesnt exist. 'rspec' is proably an xml string
try:
tree = etree.parse(StringIO(rspec), parser)
- except:
- raise InvalidRSpec('Must specify a xml file or xml string. Received: ' + rspec )
+ except Exception, e:
+ raise InvalidRSpec(str(e))
self.xml = tree.getroot()
if namespaces:
self.namespaces = namespaces
"""
pass
- def __process_slivers(self, slivers):
+ def _process_slivers(self, slivers):
"""
Creates a dict of sliver details for each sliver host
elif isinstance(sliver, basestring):
dicts.append({'hostname': sliver})
return dicts
+
def __str__(self):
return self.toxml()