Example #1
0
 def write_interface_xml(p_controller_obj, p_xml):
     if p_controller_obj.InterfaceType == 'Ethernet':
         p_xml = ethernetXML.write_interface_xml(p_xml, p_controller_obj)
     elif p_controller_obj.InterfaceType == 'Serial':
         p_xml = serialXML.write_interface_xml(p_xml, p_controller_obj)
     elif p_controller_obj.InterfaceType == 'USB':
         p_xml = usbXML.write_interface_xml(p_xml, p_controller_obj)
     else:
         LOG.error('ERROR - WriteDriverXml - Unknown InterfaceType - {} for {}'.format(p_controller_obj.InterfaceType, p_controller_obj.Name))
     p_xml  # for testing
Example #2
0
 def write_interface_xml(p_controller_obj, p_xml):
     if p_controller_obj.InterfaceType == 'Ethernet':
         p_xml = ethernetXML.write_interface_xml(p_xml, p_controller_obj)
     elif p_controller_obj.InterfaceType == 'Serial':
         p_xml = serialXML.write_interface_xml(p_xml, p_controller_obj)
     elif p_controller_obj.InterfaceType == 'USB':
         p_xml = usbXML.write_interface_xml(p_xml, p_controller_obj)
     else:
         LOG.error(
             'ERROR - WriteDriverXml - Unknown InterfaceType - {} for {}'.
             format(p_controller_obj.InterfaceType, p_controller_obj.Name))
     p_xml  # for testing
Example #3
0
 def read_interface_xml(p_controller_obj, p_controller_xml):
     """Update the controller object by extracting the passed in XML.
     """
     if p_controller_obj.InterfaceType == 'Ethernet':
         l_interface = ethernetXML.read_interface_xml(p_controller_xml)
     elif p_controller_obj.InterfaceType == 'Serial':
         l_interface = serialXML.read_interface_xml(p_controller_xml)
     elif p_controller_obj.InterfaceType == 'USB':
         l_interface = usbXML.read_interface_xml(p_controller_xml)
     else:
         LOG.error('Reading a controller driver interface section  For {} - Unknown InterfaceType - {}'.format(p_controller_obj.Name, p_controller_obj.InterfaceType))
         l_interface = None
     stuff_new_attrs(p_controller_obj, l_interface)
     return l_interface  # for testing
Example #4
0
 def read_interface_xml(p_controller_obj, p_controller_xml):
     """Update the controller object by extracting the passed in XML.
     """
     if p_controller_obj.InterfaceType == 'Ethernet':
         l_interface = ethernetXML.read_interface_xml(p_controller_xml)
     elif p_controller_obj.InterfaceType == 'Serial':
         l_interface = serialXML.read_interface_xml(p_controller_xml)
     elif p_controller_obj.InterfaceType == 'USB':
         l_interface = usbXML.read_interface_xml(p_controller_xml)
     else:
         LOG.error(
             'Reading a controller driver interface section  For {} - Unknown InterfaceType - {}'
             .format(p_controller_obj.Name, p_controller_obj.InterfaceType))
         l_interface = None
     stuff_new_attrs(p_controller_obj, l_interface)
     return l_interface  # for testing
Example #5
0
    def read_interface_xml(p_controller_obj, p_controller_xml):
        """Update the controller object by extracting the passed in XML.

        This is basically a dispatcher.

        @param p_controller_obj: This is the object we are going to stuff the interface info into.
        """
        if p_controller_obj.InterfaceType == 'Ethernet':
            l_interface = ethernetXML.read_interface_xml(p_controller_xml)
        elif p_controller_obj.InterfaceType == 'Serial':
            l_interface = serialXML.read_interface_xml(p_controller_xml)
        elif p_controller_obj.InterfaceType == 'USB':
            l_interface = usbXML.read_interface_xml(p_controller_xml)
        elif p_controller_obj.InterfaceType == 'Null':
            l_interface = nullXML.read_interface_xml(p_controller_xml)
        else:
            LOG.error('Reading a controller driver interface section  For {} - Unknown InterfaceType - {}'
                      .format(p_controller_obj.Name, p_controller_obj.InterfaceType))
            l_interface = None
        stuff_new_attrs(p_controller_obj, l_interface)
        return l_interface  # for testing