From: Tony Mack Date: Thu, 1 Sep 2011 19:49:30 +0000 (-0400) Subject: moved RSpecElement and RSpecElements to rspec_element.py X-Git-Tag: sfa-1.0-36~43 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4f570b79df28d290f60e898dc38bbb7f93373d95;p=sfa.git moved RSpecElement and RSpecElements to rspec_element.py --- diff --git a/sfa/rspecs/rspec.py b/sfa/rspecs/rspec.py index cd7e9f8c..764114a7 100755 --- a/sfa/rspecs/rspec.py +++ b/sfa/rspecs/rspec.py @@ -4,7 +4,7 @@ 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.enumeration import Enum +from sfa.rspecs.rspec_elements import RSpecElement, RSpecElements from sfa.util.faults import SfaNotImplemented, InvalidRSpec, InvalidRSpecElement @@ -28,17 +28,6 @@ class XpathFilter: xpath = '[' + xpath + ']' return xpath -# recognized top level rspec elements -RSpecElements = Enum('NETWORK', 'NODE', 'SLIVER', 'INTERFACE', 'LINK', 'VLINK') - -class RSpecElement: - def __init__(self, element_type, name, path): - if not element_type in RSpecElements: - raise InvalidRSpecElement(element_type) - self.type = element_type - self.name = name - self.path = path - class RSpec: header = '\n' template = """""" diff --git a/sfa/rspecs/rspec_elements.py b/sfa/rspecs/rspec_elements.py new file mode 100644 index 00000000..2eb0d8cd --- /dev/null +++ b/sfa/rspecs/rspec_elements.py @@ -0,0 +1,12 @@ +from sfa.util.enumeration import Enum + +# recognized top level rspec elements +RSpecElements = Enum('NETWORK', 'NODE', 'SLIVER', 'INTERFACE', 'LINK', 'VLINK') + +class RSpecElement: + def __init__(self, element_type, name, path): + if not element_type in RSpecElements: + raise InvalidRSpecElement(element_type) + self.type = element_type + self.name = name + self.path = path