[00:55] this is a crime: https://github.com/igalic/cloud-init/pull/new/bsd/device_drivers [10:45] aciba: good morning. I committed a crime, and I need some input on how bad it is https://github.com/igalic/cloud-init/pull/new/bsd/device_drivers [11:06] better match: r"""ifconfig_([^_]+?)_name="?{}"?""".format(devname) [11:06] still pretty horrible, but more stable. [11:07] i know that BSD sh allows : in function names, probably also in variable names… [11:07] $ export ifconfig_vtnet0:2_name="eth2" [11:07] export: ifconfig_vtnet0:2_name: bad variable name [11:37] meena: Good morning. I do not see problem with `ifconfig_([^_]+?)_name="?{}"?`. Another simplier option could be to split the string manually: `'ifconfig_vtnet0:2_name="eth2"'.split("ifconfig_")[-1].split("_name=")` [11:37] meena: is that naming documented/specified somewhere ? [11:38] i'm currently trying to find out where that vtnet0:2 stuff even comes from, I've never seen that on BSD [11:50] i don't see it in the handbook, in the man page, in any of the example outputs i got from people. [11:54] aciba: but, yeah, it's a design question: how do i design: get_rc_config_line(regex, fn="/etc/rc.conf")? [11:54] currently, being a regex, it returns and Optional[Match] object… (well, not explicitly, yet) so you know exactly what you getting, if you have a regex group [12:04] meena: I would probably return an Optional[str], in that way the output type is not tied to the input type, and if we overload the input parameters (for example adding a new input param or type or a new function to find lines containing a str) then the output type would be more stable. But I do not have the context. [12:09] 👍 [12:12] we could do `def get_rc_config_line(by_regex, fn="/etc/rc.conf") -> Optional[str]:` and in the future extend it to `def get_rc_config_line(by_regex=None, by_str=None, fn="/etc/rc.conf") -> Optional[str]:` [12:14] I like that. [12:14] also the split above makes it easy to target [12:15] and i would just go: if match: return line [12:16] I need to look into the Linux device_driver() implementation. I wonder if that can return None [18:13] meena: Are you developing cloud-init on freebsd? [18:19] rather, I'm mostly curious right now whether you run cloud-init _in_ a vm/container on a freebsd host and if so what tools you use (bhyve/qemu/etc) [18:26] holmanb: mostly libvirt on an Ubuntu to test right now [18:27] when i have better changes, I'll need to test them on real clouds [18:28] the blacklist driver stuff is mostly for azure, but threading that thru will require refactoring a lot [18:28] gotcha [18:34] Just wanted to give a heads up that we landed a qemu tutorial that might be usable on BSDs (haven't tested). [18:35] I know you have plenty of irons in the fire, so no pressure if you'd rather not :)