2 Library for dynamic flow construction.
3 Authors: james.luhrsen@hp.com
7 xmltodict and json libs not needed at this point, but may be useful in
14 from robot.libraries.BuiltIn import BuiltIn
16 ##bare bones xml for building a flow
17 xml_skeleton = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' + \
18 '<flow xmlns="urn:opendaylight:flow:inventory">' + \
19 '<instructions></instructions>' + \
25 Flow class for creating and interacting with OpenFlow flows
45 def set_field(self, field, value):
47 allows for generically setting any attribute in this
48 class based on the 'field' passed in. In the future,
49 adding a new attribute only requires that single line
50 addition. no need for additional setter.
52 setattr(self, field, value)
54 def Make_Flow_Object():
56 Robot Keyword to create and return an instance of the Flow
62 def Set_Flow_Field(flow, field, value):
64 Robot Keyword to allow the modification (setting) of the
65 flow object attributes
67 flow.set_field(field,value)
71 #def Convert_Flow_XML_To_Json(flow):
73 # There may be a need in the future to use json to push
74 # flows, as opposed to xml format that is prevalent in
75 # test code at this point. This function will give a
76 # conversion, but unsure if it's proper. Also, unsure
77 # if the xmltodict library is viable in the CSIT environment
79 # flowXmlDict = xmltodict.parse(flow.xml)
80 # flow.json = json.dumps(flowXmlDict)