Merge branch 'upstreammaster'
[sfa.git] / sfa / rspecs / rspec_elements.py
1 from sfa.util.enumeration import Enum
2
3 # recognized top level rspec elements
4 RSpecElements = Enum(NETWORK='NETWORK', 
5                      COMPONENT_MANAGER='COMPONENT_MANAGER', 
6                      SLIVER='SLIVER', 
7                      SLIVER_TYPE='SLIVER_TYPE', 
8                      NODE='NODE', 
9                      INTERFACE='INTERFACE', 
10                      INTERFACE_REF='INTERFACE_REF', 
11                      LINK='LINK', 
12                      LINK_TYPE='LINK_TYPE', 
13                      SERVICE='SERVICE',
14                      PROPERTY='PROPERTY'
15                 )
16
17 class RSpecElement:
18     def __init__(self, element_type, path):
19         if not element_type in RSpecElements:
20             raise InvalidRSpecElement(element_type)
21         self.type = element_type
22         self.path = path