'Convert the backend specification into a list of YAML lines.'

def ToYaml(self):

    statements = [('-    name:    %s' % self.name)]
    for (entry, field) in [('instances', self.instances), ('class', self.instance_class), ('max_concurrent_requests', self.max_concurrent_requests)]:
        if (field is not None):
            statements += [('        %s:    %s' % (entry, str(field)))]
    if self.options:
        options_str = ',    '.join(sorted(list(self.options)))
        statements += [('        options:    %s' % options_str)]
    return statements
