Merge branch 'master' into eucalyptus-devel
[sfa.git] / sfa / rspecs / rspec.py
index af33d41..f2fa662 100755 (executable)
@@ -4,13 +4,11 @@ from StringIO import StringIO
 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
@@ -49,8 +47,8 @@ class RSpec:
             # '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
@@ -131,7 +129,7 @@ class RSpec:
         """
         pass 
 
-    def __process_slivers(self, slivers):
+    def _process_slivers(self, slivers):
         """
         Creates a dict of sliver details for each sliver host
         
@@ -147,6 +145,7 @@ class RSpec:
             elif isinstance(sliver, basestring):
                 dicts.append({'hostname': sliver}) 
         return dicts
+
     def __str__(self):
         return self.toxml()