Is there any option to query the Launchpad API for a list of all LTS releases?

Otherwise, I can get the releases and their status by

from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT

cachedir = "/tmp/launchpadlib/cache/"
lp = Launchpad.login_anonymously('ppastats', 'edge', cachedir, version='devel')
launchpad = lp
[s.status for s in launchpad.distributions["ubuntu"].series]

But how to filter this by the LTS criterion?

Thanks a lot in advance.


I'm afraid Launchpad doesn't really know about this itself in a straightforward machine-readable way, so it can't export that information right now. Your best bet is probably going to be something like filtering on the description, although I believe that most scripts that need to know this right now simply hardcode the list since it changes infrequently.

Also, please don't use "edge", as it's long-obsolete and exists only for compatibility. Use "production" instead.


Is there any reason you can't just assume that the oldest active release is the oldest LTS? LTS are the longest supported so there'll never be a non-LTS outliving an LTS. Eg:

>>> [s.name for s in lp.distributions['ubuntu'].series if s.active][-1]

Also, LTS's are released in April of even-numbered years, so to get ALL currently supported LTS you could do a trick like this:

>>> [s.name for s in lp.distributions['ubuntu'].series if s.active and s.version.endswith('.04') and not int(s.version.split('.')[0]) % 2]
['trusty', 'precise']

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.