Comment 1 for bug 753249

Revision history for this message
Gavin Panella (allenap) wrote :

Locally, I applied the following patch to devel:

{{{
=== modified file 'lib/lp/registry/javascript/distroseries.js'
--- lib/lp/registry/javascript/distroseries.js 2011-03-29 20:13:28 +0000
+++ lib/lp/registry/javascript/distroseries.js 2011-04-07 10:01:44 +0000
@@ -716,6 +716,7 @@
                     "Copy Source and Rebuild")
             }
         };
+ alert(Y.JSON.stringify(config, null, 4));
         var parent = this.deriveFromChoice.get("value");
         this.client.named_post(
             parent, "deriveDistroSeries", config);

=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2011-04-04 01:42:16 +0000
+++ lib/lp/registry/model/distroseries.py 2011-04-07 10:09:34 +0000
@@ -1939,6 +1939,8 @@
                            description=None, version=None,
                            architectures=(), packagesets=(), rebuild=False):
         """See `IDistroSeries`."""
+ from pprint import pprint
+ pprint(vars())
         # XXX StevenK bug=643369 This should be in the security adapter
         # This should be allowed if the user is a driver for self.parent
         # or the child.parent's drivers.

}}}

I added a few packagesets:

{{{
$ bin/harness
>>> d = store.find(Distribution, name=u'ubuntu').one()
>>> ds = d.getSeries(u"warty")
>>> factory.makePackageset(u"britney", distroseries=ds)
>>> factory.makePackageset(u"spears", distroseries=ds)
>>> transaction.commit()
}}}

Then, on https://launchpad.dev/deribuntu/deriwarty/+initseries, I
chose to derive from ubuntu/warty and selected all the available
architectures and packagesets. I got the following JSON from both
Firefox 4 and Chromium:

{
    "on": {},
    "parameters": {
        "name": "deriwarty",
        "distribution": "https://launchpad.dev/api/devel/deribuntu",
        "architectures": [
            "hppa",
            "i386"
        ],
        "packagesets": [
            "britney",
            "spears"
        ],
        "rebuild": false
    }
}

Server-side, at the top of deriveDistroSeries, vars() gives (slightly
edited):

{'architectures': [u'hppa,i386'],
 'description': None,
 'displayname': None,
 'distribution': <Distribution 'Deribuntu' (deribuntu)>,
 'name': u'deriwarty',
 'packagesets': [u'britney,spears'],
 'rebuild': False,
 'self': <DistroSeries u'warty'>,
 'summary': None,
 'title': None,
 'user': <Person at 0xb60d0d0 name16 (Foo Bar)>,
 'version': None}

Then I tried again, with no architectures or packagesets selected, and
got:

{
    "on": {},
    "parameters": {
        "name": "deriwarty",
        "distribution": "https://launchpad.dev/api/devel/deribuntu",
        "architectures": [],
        "packagesets": [],
        "rebuild": false
    }
}

Server-side:

{'architectures': [u''],
 'description': None,
 'displayname': None,
 'distribution': <Distribution 'Deribuntu' (deribuntu)>,
 'name': u'deriwarty',
 'packagesets': [u''],
 'rebuild': False,
 'self': <DistroSeries u'warty'>,
 'summary': None,
 'title': None,
 'user': <Person at 0x9203e50 name16 (Foo Bar)>,
 'version': None}

I'm not sure what is causing that empty string to be added. My
suspicious is that it's lazr.restful, but I need to check some
more.