[Pulp-list] changed Consumer.package_profile format

Mike McCune mmccune at redhat.com
Mon Jun 28 21:10:23 UTC 2010


Before we had:

consumer: {
    "_id": "localhost10",
    "_ns": "consumers",
    "description": "localhost10",
    "id": "localhost10",
    "package_profile": {
      {
      "Canna-libs": [
       {
        "arch": "x86_64",
        "epoch": "",
        "name": "Canna-libs",
        "release": "27.fc11",
        "version": "3.7p3"
       }
      ],
      "ConsoleKit": [
       {
        "arch": "x86_64",
        "epoch": "",
        "name": "ConsoleKit",
        "release": "8.fc11",
        "version": "0.3.0"
       }
      ],
      "ConsoleKit-libs": [
       {
        "arch": "x86_64",
        "epoch": "",
        "name": "ConsoleKit-libs",
        "release": "8.fc11",
        "version": "0.3.0"
       }
      ],

Now we have:

consumer: {
  "_id": "localhost",
  "_ns": "consumers",
  "description": "localhost",
  "id": "localhost",
  "package_profile": [
   {
    "arch": "x86_64",
    "epoch": 0,
    "name": "php-common",
    "release": "1.fc11",
    "version": "5.2.13"
   },
   {
    "arch": "x86_64",
    "epoch": 0,
    "name": "plymouth-utils",
    "release": "0.2009.05.15.1.fc11",
    "version": "0.7.0"
   },
   {
    "arch": "x86_64",
    "epoch": 0,
    "name": "freetype",
    "release": "5.fc11",
    "version": "2.3.9"
   },
   {
    "arch": "i586",
    "epoch": 0,
    "name": "gdbm",
    "release": "31.fc11",
    "version": "1.8.0"
   },
...
   ]}

Note that it is simplified to just a flat list of dictionaries vs a 
dictionary keyed off name with a list of versions.

This was to facilitate indexing in mongo based on package_profile.name 
which improved query performance and as a side effect made the 
data-structure simpler.


-- 
Mike McCune
mmccune AT redhat.com
Red Hat Engineering       | Portland, OR
Systems Management        | 650.254.4248




More information about the Pulp-list mailing list