We should separate this function in components, as it does multiple things.
First, it can recursively walk over all the nodes in a tree.
Second, it filters on the nodes which have a certain function.
Third, it maps a function on all items.
Python has a great built-in called map, so we shouldn't implement the second one.
The first is a very simple function, like os.walk.

def walk(service, recursive=True):
    for s in service:
        yield s
        if recursive:
            yield from walk(s) # Python3, but you get the point.


Now we should be able to do:

def get_config(s):
    try:
       return s.get_uwsgi_config()
    except AttributeError:
      return ''
result = map(get_config, walk(self.parent))

Correct me if I'm missing something.