'Parse an ``Application`` instance for its links and return
a ``dict`` representing the Flocker-format YAML configuration
for those links.'

def convert_links(self):

    links = []
    if self._application.links:
        for link in self._application.links:
            links.append(dict(local_port=link.local_port, remote_port=link.remote_port, alias=link.alias))
        return sorted(links)
    return None
