/srv/irclogs.ubuntu.com/2022/10/18/#cloud-init.txt

meenai should be pushing my stuff to Codeberg instead of github with how unhappy Travis has been with my work14:20
meenaor, you know, develop on the VM that I'm testing??14:20
meenaokay! I have the parser and the state object in somewhat usable form14:48
meenabut now I'm already wishing I could access the Ifstate objects by name14:50
meenaI'd have to make it … iterable?14:50
meenaAlso: https://github.com/igalic/cloud-init/blob/net/add-ifconfig-parsers/cloudinit/distros/parsers/ifconfig.py ← should I put me in (c) here or the FreeBSD Foundation?14:55
meenaalso, i need to fix def foo(self) -> list[str]:15:10
meenaPython 3.8 doesn't seem to like that15:11
meenaMight have to use List[str]?15:11
meenaokay, 1 mypy error down, 48 to go…15:20
meenahrm… might be easier to return  {'name': Ifstate(name, ifs[name])} even if that duplicates name…15:24
* smoser learns of codeberg15:55
=== esv_ is now known as esv
meenasmoser: it's a coop. When i have money again, I'm planning to become a contributing member17:10
anankejust a quick sanity check: when using write_files, and specifying permissions for a file to be created, will that also affect permissions for all of the intermediate dirs that may need to be created?18:13
meenaananke: i couldn't figure it out from a quick glance at the docs. What does the source say?20:13
meenaI need some help with those mypy errors. Half of them make no sense to me.20:31
meenacloudinit/distros/parsers/ifconfig.py:17: error: Need type annotation for "DEFAULT_IF" # why??20:32
meenaWhere's aciba when you, when I need 'em?21:06
falcojrDEFAULT_IF: Mapping[str, Any] ... ?21:08
* meena is in #python asking important questions21:12
* falcojr missed first half of that conversation21:14
meenafalcojr: got rid of DEFAULT_IF completely…21:51
meenanew code: https://codeberg.org/meena/cloud-init/src/commit/0f0aaec6cb1b8318e7d859af899c06caf264170b/cloudinit/distros/parsers/ifconfig.py but now mypy is giving me lots of:21:52
meenacloudinit/distros/parsers/ifconfig.py:91: error: Item "None" of "Optional[Ifstate]" has no attribute "flags"21:52
meenacloudinit/distros/parsers/ifconfig.py:92: error: Item "None" of "Optional[Ifstate]" has no attribute "up"21:52
meenacloudinit/distros/parsers/ifconfig.py:93: error: Item "None" of "Optional[Ifstate]" has no attribute "mtu"21:52
meenaerrors…21:52
meenaWhat the heck is an attribute?21:52
meenaoh, i created private attributes…21:53
meenano… no i didn't.21:53
meenaoh… removing that dev = None, fixes it…21:57
meenaholy shit it's finished and beautiful (please ignore the journey)22:01
meenawell, I'm down to 1 mypy error22:01
meenaphew. what a journey22:09
meenai'm gonna un-draft this, so y'all can take a look, and make suggestions for better tests, and where to first hook it into22:10
meenaI feel like the most interesting function would be get_interfaces_by_mac()22:12
meenaalso having a driver mapping would be good…22:13
Guest93Hello everyone. I am writing a custom datasource and for some reason the fallback None keeps being used; not sure how to test why even. In /run/cloud-init/cloud.cfg I see datasource_list: [ MINE, None]. I check in the /var/log/cloud-init.log and I see: Looking for data source in: [ 'MINE', 'None'] via packages... Then immediately on next line23:22
Guest93"Searching for network data source in: ['DataSourceNone']. I have my custom data source in sources/DataSourceMINE.py. But, for some reason it's not being detected. I added to to settings.py and updated ds-identify too. I also installed freshest cloud-init (22.3.3) and added my modifications and still nothing. How do I test that my actual datasource23:22
Guest93works as intended?23:22
meenaGuest93: what do you get when you run ds-identify?23:39
meenasudo -H /usr/local/lib/cloud-init/ds-identify or where that is on your platform23:39
meenaand I mean: the full log23:39
Guest93meena: see https://0bin.net/paste/JLIBp3gA#VSyVBDTuK18Rp87jO43cpTh+Qmvt-56Qe8jyOPH3ZdT; it does find the datasource it seems.23:45
meenaGuest93: so why does cloud-init then disagree with that? What does the log say?23:46
Guest93meena: All that cloud-init.log tells me: https://0bin.net/paste/pBLNvg23#nA8-BmQtbbKdEdysVrvIMZCITt94HGaErr0zB+H3Xjx . When I run `cloud-init -d init` (after cloud-init clean). I do not have DEP_NETWORK though on my datasource. That may be the requirement in this case? Or, do I need to test this differently?23:50
meenaGuest93: there has to be a discovery phase before this: 2022-10-18 23:30:57,441 - __init__.py[DEBUG]: Looking for data source in: ['MINE', 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']23:51
meenacan you run cloud-init clean -lrs # ceans logs, state, and reboots23:51
meenawhen we'll get a fresh set of logs, and can get a clearer idea23:51

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