def _create_coordinator_xml(self, coord_configs, config_filter=None,
                                appname='coord'):
        doc = xml.Document()

        # Create the <coordinator-app> base element
        coord = doc.createElement('coordinator-app')
        coord.attributes['name'] = appname
        coord.attributes['start'] = "${start}"
        coord.attributes['end'] = "${end}"
        coord.attributes['frequency'] = "${frequency}"
        coord.attributes['timezone'] = 'UTC'
        coord.attributes['xmlns'] = 'uri:oozie:coordinator:0.2'

        doc.appendChild(coord)

        action = doc.createElement('action')
        workflow = doc.createElement('workflow')
        coord.appendChild(action)
        action.appendChild(workflow)
        x.add_text_element_to_tag(doc, "workflow", 'app-path',
                                  "${workflowAppUri}")
        configuration = doc.createElement('configuration')
        workflow.appendChild(configuration)

        default_configs = []
        if config_filter is not None:
            default_configs = [cfg['name'] for cfg in config_filter]

        for name in sorted(coord_configs):
            if name in default_configs or config_filter is None:
                x.add_property_to_configuration(doc, name, coord_configs[name])

        # Return newly created XML
        return doc.toprettyxml(indent="  ")
dataset/ETHPy150Open openstack/sahara/sahara/service/edp/oozie/engine.py/OozieJobEngine._create_coordinator_xml/original