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(
5     BWLIMIT='BWLIMIT',
6     EXECUTE='EXECUTE',
7     NETWORK='NETWORK', 
8     COMPONENT_MANAGER='COMPONENT_MANAGER',
9     INSTALL='INSTALL', 
10     INTERFACE='INTERFACE', 
11     INTERFACE_REF='INTERFACE_REF',
12     LOCATION='LOCATION', 
13     LOGIN='LOGIN', 
14     LINK='LINK', 
15     LINK_TYPE='LINK_TYPE', 
16     NODE='NODE', 
17     PROPERTY='PROPERTY',
18     SERVICES='SERVICES',
19     SLIVER='SLIVER', 
20     SLIVER_TYPE='SLIVER_TYPE', 
21 )
22
23 class RSpecElement:
24     def __init__(self, element_type, path):
25         if not element_type in RSpecElements:
26             raise InvalidRSpecElement(element_type)
27         self.type = element_type
28         self.path = path