/srv/irclogs.ubuntu.com/2018/10/31/#launchpad.txt

kjackalhi, I am trying to use the launchpad API and I cannot figure out how to add a list of architectures in a snap package. What issupposed to go into launchpad.snaps.new ?16:56
kjackalI can add a single processor but I do not know how to add a list of them?16:56
nacchttps://launchpad.net/+apidoc/devel.html#processor16:58
kjackalthanks nacc, how can I put two of those in a single entity?16:59
kjackal        arm_proc = launchpad.processors.getByName(name="arm64")17:00
kjackal        amd_proc = launchpad.processors.getByName(name="amd64")17:00
kjackal        new_snap.setProcessors(processors=<what goes here?>)17:00
kjackalnacc: ^17:00
nacckjackal: do you have a link to your code?17:00
nacckjackal: ah ok17:00
naccum, i'm not 100% sure, tbh -- did you try passing those as a list?17:01
kjackalnacc: in a few forms, but with no success17:02
kjackalwhat kind of list does it expect?17:02
nacckjackal: you could try getting the current snap's definition and then seeing what it has in that processors_collection member?17:03
kjackalthis does not help much it is an <lazr.restfulclient.resource.Collection object at 0x7f51b7eb44a8>. I am obviously not good at this...17:09
kjackalbut I cannot feed that to setprocessors17:13
kjackalnacc: ^17:13
nacckjackal: we might need cjwatson or wgrant to give insight17:15
kjackalfor completeness, I am trying to figure out how to use the "processors" parameter in creating a new snap https://github.com/juju-solutions/kubernetes-jenkins/blob/master/microk8s/update-gh-branches-and-lp-builders.py#L12017:16
nacclooking17:24
nacckjackal: so do you have it working with a single arch?17:25
nacckjackal: and can you link to what you tried doing?17:25
kjackal nacc literaly the extra part are these 3 lines:         new_snap = self._get_snap()17:26
kjackal        arm_proc = launchpad.processors.getByName(name="arm64")17:26
kjackal        amd_proc = launchpad.processors.getByName(name="amd64")17:26
kjackal        new_snap.setProcessors(processors=amd_proc)17:26
wgrantkjackal, nacc: convert the collection to a list (a collection object is a lazy iterator over a remote collection), or use processors.getByName and make a list from that17:27
kjackalexcuse my ignorance wgrant, how do you make a list from the above arm_proc and amd_proc ?17:28
wgrantNormal python17:28
wgrant[arm_proc, amd64_proc]17:28
kjackalno, that does not work, let me show you the output17:28
kjackalhttps://pastebin.ubuntu.com/p/7Myym7jymX/17:30
kjackalwgrant: ^17:31
nacckjackal: well, right even if only passing one, you need it to be a list (above)17:31
naccwgrant: ack on what you suggested17:31
kjackalnacc: no if it is a single processor it does not need to be a list. This works perfecctly:         new_snap.setProcessors(processors=amd_proc)17:32
wgrantYou can always fall back to processors=['/+processor/amd64', '/+processor/i386'] etc. I'm afk so can't test the launchpadlib bits myself. But what is the type of amd_proc in the case that works?17:34
wgrantAh17:40
kjackalit is a {Entry} dict, I think17:40
wgrantSo the WADL declaration is bad, I think17:41
wgrantIt won't automatically serialise a list of objects17:41
wgrantBut a list of paths works fine17:41
wgrant(but +processors, not +processor as I said above)17:41
kjackaltrying it now17:42
kjackalAh, finally worked! Thank you wgrant, nacc17:44
kjackalthis worked new_snap.setProcessors(processors=['/+processors/amd64', '/+processors/arm64']), let me try to add this to the new constractor17:44
cjwatsonIIRC it's that we don't have a way to declare that kind of nested structure in WADL.  Similar issue as I mentioned the other day regarding git permissions stuff.17:48
wgrantkjackal: you can also use .self_link on the processor object (recommended in case we change the URLs, though that's somewhat unlikely)17:49
wgrantI thought restfulclient could do it on serialisation, just not deserialisation. Maybe I misremember17:49
cjwatsonI don't think so but the code is super-twisty and it's well within the bounds of imagination that I missed something there17:50
kjackalit is a bit problematic since I wouldnt normaly know about the processors=['/+processors/amd64', '/+processors/arm64'] syntax17:57
cjwatsonYou can sort of see it if you do list() on an existing processors collection (gives you longer URLs, but equivalent in this case)18:06
cjwatsonBut it's indeed a bit opaque18:07
kyrofaThis git branch was updated 20 hours ago, but Launchpad still hasn't registered it as having changed: https://code.launchpad.net/~nextcloud-snappy-dev/nextcloud-snap/+git/nextcloud-snap/+ref/1218:53
kyrofai.e. the change doesn't show up online nor has the snap been rebuilt18:53
kyrofaBut if I clone it, I see it18:53
kyrofaIs there anything I can do to convince it to update?18:54
kyrofacjwatson, if you're around, perhaps you know?19:27
kyrofaPerhaps it'll work if I just manually poke the new build19:53
cjwatsonkyrofa: lp.load('/~nextcloud-snappy-dev/nextcloud-snap/+git/nextcloud-snap').rescan()23:22

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!