Merge branch 'master' of ssh://git.f-lab.fr/git/sfa
[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                      NODE='NODE', 
8                      INTERFACE='INTERFACE', 
9                      LINK='LINK', 
10                      SERVICE='SERVICE'
11                 )
12
13 class RSpecElement:
14     def __init__(self, element_type, path):
15         if not element_type in RSpecElements:
16             raise InvalidRSpecElement(element_type)
17         self.type = element_type
18         self.path = path