tech musings (python, pytest)
one interesting thing i'm noticing about using pytest more extensively in cloud-init is that it effectively lets you build a DSL for your testing, to an extent that the Python ecosystem generally doesn't go.
my intuition has been that we should be documenting (and testing!) our fixtures as if they were normal code, and this realisation kinda fills in the reasoning behind that intuition.
i'm currently working through what will be involved for a substantial refactor in cloud-init, and found https://github.com/davidfraser/pyan which generates call graphs for #python via static analysis. The image is what `cloudinit.net` looks like, and it's been very helpful for working out what relates to what.
Just received the 10th Ubuntu feature freeze email since I joined Canonical _almost_ 5 years ago, and am in a contemplative mood.
LMAO we just introduced black to format this codebase, but to reduce the codebase churn we disabled the string normalisation (so it won't change single quotes to double quotes). The first, the _very_ first PR after we land that has someone bikeshedding the (double) quotes that I chose to use.
Technical details
dracut writes its network configuration out in sysconfig (unsurprisingly). cloud-init has first class support for writing sysconfig itself, so that we can render network configuration on distros that use sysconfig.
It looks to me, though, like we don't have support for parsing sysconfig network configuration, so I might have to write that??? Much bigger chunk of work than I thought, if so.
(Waiting for the right person to log on so I can double check.)
Technical details
Specifically, I'm currently working on support for parsing dracut-generated network configuration, so that cloud-init can combine the network configuration that it generates for iSCSI root with network configuration from other sources (e.g. a cloud's metadata service) to have a full view of the system's network configuration.
Just discovered that what I thought was going to be a (relatively) simple case of hooking up an input to some existing code just got blown out of the water because we (unexpectedly, to me) don't have support for parsing this format as an input, only for writing it out.
Staring at my screen somewhat blankly now.
Just realised that my squid-deb-proxy setup is pointless at the moment because my desktop is pointing at mirror.csclub.uwaterloo.ca, my laptop is pointing at ca.archive.ubuntu.com and my schroots are pointing at archive.ubuntu.com. So all I'm doing is caching the same thing three times over. >.<
Just found out there's a Synergy fork called barrier: https://github.com/debauchee/barrier
I'll probably check that out at some point, because it's actually packaged properly for Debian/Ubuntu.
I've got the "man, I wish I knew Javascript" to "wow, I'm glad I don't know Javascript" feedback loop down to about 3 minutes.
An interesting idea that I'm not invested enough in to do anything about: a bot (framework) for playing interactive fiction games
Just wasted 20 minutes by not noticing that `adduser_cmd` in fact runs useradd (not the similar utility adduser!):
adduser_cmd = ['useradd', name]
😠
Just had an idea for a fun wrestling coding project: use Cagematch's data to produce training trees for wrestlers, showing who they "descend" from in training terms.
Yes, that's right, the very important things I was batch-adding to Todoist were... One Piece episodes.
https://write.wrestle.town/oddbloke/quick-script-getting-a-list-of-one-piece-episodes details a quick Python script I wrote to generate the text to copy/paste into Todoist (as well as some brief observations about things that tripped me up when writing it).
Now to watch some One Piece!
Just cut a new release of sphinx-git, v11.0.0:
https://github.com/OddBloke/sphinx-git/releases/tag/v11.0.0
Very weird that I started this project 7 years ago, that's a long time!
Black Lives Matter.
A wrestling-loving, lefty, intersectional feminist free software engineer. Interested in Python, Rust, figuring out ethical software.
Heteroromantic asexual.
I rarely boost images without an image description. Please call me out if I don't describe an image I post!
I'm the administrator of this server (i.e. the mayor of Wrestle Town).