[16:56] hi, 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] I can add a single processor but I do not know how to add a list of them? [16:58] https://launchpad.net/+apidoc/devel.html#processor [16:59] thanks nacc, how can I put two of those in a single entity? [17:00] arm_proc = launchpad.processors.getByName(name="arm64") [17:00] amd_proc = launchpad.processors.getByName(name="amd64") [17:00] new_snap.setProcessors(processors=) [17:00] nacc: ^ [17:00] kjackal: do you have a link to your code? [17:00] kjackal: ah ok [17:01] um, i'm not 100% sure, tbh -- did you try passing those as a list? [17:02] nacc: in a few forms, but with no success [17:02] what kind of list does it expect? [17:03] kjackal: you could try getting the current snap's definition and then seeing what it has in that processors_collection member? [17:09] this does not help much it is an . I am obviously not good at this... [17:13] but I cannot feed that to setprocessors [17:13] nacc: ^ [17:15] kjackal: we might need cjwatson or wgrant to give insight [17:16] for 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#L120 [17:24] looking [17:25] kjackal: so do you have it working with a single arch? [17:25] kjackal: and can you link to what you tried doing? [17:26] nacc literaly the extra part are these 3 lines: new_snap = self._get_snap() [17:26] arm_proc = launchpad.processors.getByName(name="arm64") [17:26] amd_proc = launchpad.processors.getByName(name="amd64") [17:26] new_snap.setProcessors(processors=amd_proc) [17:27] kjackal, 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 that [17:28] excuse my ignorance wgrant, how do you make a list from the above arm_proc and amd_proc ? [17:28] Normal python [17:28] [arm_proc, amd64_proc] [17:28] no, that does not work, let me show you the output [17:30] https://pastebin.ubuntu.com/p/7Myym7jymX/ [17:31] wgrant: ^ [17:31] kjackal: well, right even if only passing one, you need it to be a list (above) [17:31] wgrant: ack on what you suggested [17:32] nacc: 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:34] You 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:40] Ah [17:40] it is a {Entry} dict, I think [17:41] So the WADL declaration is bad, I think [17:41] It won't automatically serialise a list of objects [17:41] But a list of paths works fine [17:41] (but +processors, not +processor as I said above) [17:42] trying it now [17:44] Ah, finally worked! Thank you wgrant, nacc [17:44] this worked new_snap.setProcessors(processors=['/+processors/amd64', '/+processors/arm64']), let me try to add this to the new constractor [17:48] IIRC 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:49] kjackal: you can also use .self_link on the processor object (recommended in case we change the URLs, though that's somewhat unlikely) [17:49] I thought restfulclient could do it on serialisation, just not deserialisation. Maybe I misremember [17:50] I don't think so but the code is super-twisty and it's well within the bounds of imagination that I missed something there [17:57] it is a bit problematic since I wouldnt normaly know about the processors=['/+processors/amd64', '/+processors/arm64'] syntax [18:06] You can sort of see it if you do list() on an existing processors collection (gives you longer URLs, but equivalent in this case) [18:07] But it's indeed a bit opaque [18:53] This 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/12 [18:53] i.e. the change doesn't show up online nor has the snap been rebuilt [18:53] But if I clone it, I see it [18:54] Is there anything I can do to convince it to update? [19:27] cjwatson, if you're around, perhaps you know? [19:53] Perhaps it'll work if I just manually poke the new build [23:22] kyrofa: lp.load('/~nextcloud-snappy-dev/nextcloud-snap/+git/nextcloud-snap').rescan()