[Bug 1253208] [NEW] python-distro-info hard to use for some cases

Scott Moser smoser at ubuntu.com
Wed Nov 20 19:19:06 UTC 2013


Public bug reported:

Getting information out of distro_info for some common things such as getting fullname or version for a known codename is very difficult.
There is no easy way to get a full list of all the data to filter through.

I've written a 'get_ubuntu_info' method at https://gist.github.com/smoser/6784120#file-distro_info_dict
that gives me a list of dicts with info for each release for a given date.  I called it 'get_ubuntu_info', but it works for debian.

It results in a list of dicts like:
 [{'codename': 'trusty', 'devel': True,
  'full_codename': 'Trusty Tahr', 'fullname': 'Ubuntu 14.04 LTS "Trusty Tahr"',
  'lts': True, 'supported': True, 'version': '14.04'}]


Perhaps we could add a helper like this in the library?

It also seems there is a smll bug in output formatting if a release does not have a version (Sid and Experimental):
  >>> distro_info.DebianDistroInfo().supported(result="fullname")
  >>> ['Debian 6.0 "Squeeze"',  'Debian 7.0 "Wheezy"',  'Debian 8.0 "Jessie"',  'Debian  "Sid"',  'Debian  "Experimental"']

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: distro-info 0.8.2
ProcVersionSignature: User Name 3.2.0-56.86-virtual 3.2.51
Uname: Linux 3.2.0-56-virtual x86_64
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Wed Nov 20 17:12:42 2013
Ec2AMI: ami-000005ec
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.tiny
Ec2Kernel: aki-00000548
Ec2Ramdisk: ari-00000548
MarkForUpload: True
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: distro-info
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: distro-info (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug ec2-images precise

** Attachment added: "get_distro_info main and method"
   https://bugs.launchpad.net/bugs/1253208/+attachment/3913526/+files/get_distro_info

** Description changed:

- Getting information out of distro_info for some common things such as getting fullname for a known codename is very difficult.
+ Getting information out of distro_info for some common things such as getting fullname or version for a known codename is very difficult.
  There is no easy way to get a full list of all the data to filter through.
  
  I've written a 'get_ubuntu_info' method at https://gist.github.com/smoser/6784120#file-distro_info_dict
  that gives me a list of dicts with info for each release for a given date.  I called it 'get_ubuntu_info', but it works for debian.
  
  Perhaps we could add a helper like this in the library?
  
  It also seems there is a smll bug in output formatting if a release does not have a version (Sid and Experimental):
-   >>> distro_info.DebianDistroInfo().supported(result="fullname")
-   >>> ['Debian 6.0 "Squeeze"',  'Debian 7.0 "Wheezy"',  'Debian 8.0 "Jessie"',  'Debian  "Sid"',  'Debian  "Experimental"']
+   >>> distro_info.DebianDistroInfo().supported(result="fullname")
+   >>> ['Debian 6.0 "Squeeze"',  'Debian 7.0 "Wheezy"',  'Debian 8.0 "Jessie"',  'Debian  "Sid"',  'Debian  "Experimental"']
  
  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: distro-info 0.8.2
  ProcVersionSignature: User Name 3.2.0-56.86-virtual 3.2.51
  Uname: Linux 3.2.0-56-virtual x86_64
  ApportVersion: 2.0.1-0ubuntu17.6
  Architecture: amd64
  Date: Wed Nov 20 17:12:42 2013
  Ec2AMI: ami-000005ec
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.tiny
  Ec2Kernel: aki-00000548
  Ec2Ramdisk: ari-00000548
  MarkForUpload: True
  ProcEnviron:
-  TERM=screen
-  PATH=(custom, no user)
-  LANG=en_US.UTF-8
-  SHELL=/bin/bash
+  TERM=screen
+  PATH=(custom, no user)
+  LANG=en_US.UTF-8
+  SHELL=/bin/bash
  SourcePackage: distro-info
  UpgradeStatus: No upgrade log present (probably fresh install)

** Description changed:

  Getting information out of distro_info for some common things such as getting fullname or version for a known codename is very difficult.
  There is no easy way to get a full list of all the data to filter through.
  
  I've written a 'get_ubuntu_info' method at https://gist.github.com/smoser/6784120#file-distro_info_dict
  that gives me a list of dicts with info for each release for a given date.  I called it 'get_ubuntu_info', but it works for debian.
+ 
+ It results in a list of dicts like:
+  [{'codename': 'trusty', 'devel': True,
+   'full_codename': 'Trusty Tahr', 'fullname': 'Ubuntu 14.04 LTS "Trusty Tahr"',
+   'lts': True, 'supported': True, 'version': '14.04'}]
+ 
  
  Perhaps we could add a helper like this in the library?
  
  It also seems there is a smll bug in output formatting if a release does not have a version (Sid and Experimental):
    >>> distro_info.DebianDistroInfo().supported(result="fullname")
    >>> ['Debian 6.0 "Squeeze"',  'Debian 7.0 "Wheezy"',  'Debian 8.0 "Jessie"',  'Debian  "Sid"',  'Debian  "Experimental"']
  
  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: distro-info 0.8.2
  ProcVersionSignature: User Name 3.2.0-56.86-virtual 3.2.51
  Uname: Linux 3.2.0-56-virtual x86_64
  ApportVersion: 2.0.1-0ubuntu17.6
  Architecture: amd64
  Date: Wed Nov 20 17:12:42 2013
  Ec2AMI: ami-000005ec
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.tiny
  Ec2Kernel: aki-00000548
  Ec2Ramdisk: ari-00000548
  MarkForUpload: True
  ProcEnviron:
   TERM=screen
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: distro-info
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to distro-info in Ubuntu.
https://bugs.launchpad.net/bugs/1253208

Title:
  python-distro-info hard to use for some cases

Status in “distro-info” package in Ubuntu:
  New

Bug description:
  Getting information out of distro_info for some common things such as getting fullname or version for a known codename is very difficult.
  There is no easy way to get a full list of all the data to filter through.

  I've written a 'get_ubuntu_info' method at https://gist.github.com/smoser/6784120#file-distro_info_dict
  that gives me a list of dicts with info for each release for a given date.  I called it 'get_ubuntu_info', but it works for debian.

  It results in a list of dicts like:
   [{'codename': 'trusty', 'devel': True,
    'full_codename': 'Trusty Tahr', 'fullname': 'Ubuntu 14.04 LTS "Trusty Tahr"',
    'lts': True, 'supported': True, 'version': '14.04'}]

  
  Perhaps we could add a helper like this in the library?

  It also seems there is a smll bug in output formatting if a release does not have a version (Sid and Experimental):
    >>> distro_info.DebianDistroInfo().supported(result="fullname")
    >>> ['Debian 6.0 "Squeeze"',  'Debian 7.0 "Wheezy"',  'Debian 8.0 "Jessie"',  'Debian  "Sid"',  'Debian  "Experimental"']

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: distro-info 0.8.2
  ProcVersionSignature: User Name 3.2.0-56.86-virtual 3.2.51
  Uname: Linux 3.2.0-56-virtual x86_64
  ApportVersion: 2.0.1-0ubuntu17.6
  Architecture: amd64
  Date: Wed Nov 20 17:12:42 2013
  Ec2AMI: ami-000005ec
  Ec2AMIManifest: FIXME
  Ec2AvailabilityZone: nova
  Ec2InstanceType: m1.tiny
  Ec2Kernel: aki-00000548
  Ec2Ramdisk: ari-00000548
  MarkForUpload: True
  ProcEnviron:
   TERM=screen
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: distro-info
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/distro-info/+bug/1253208/+subscriptions



More information about the foundations-bugs mailing list