=== hi is now known as Guest3228
faaTomasD: freebsd default only sample cobfig, cp cloud.cfg.d/05_logging.cfg.sample cloud.cfg.d/05_logging.cfg08:39
faaNoCloud perfect work with iso, example sysutils/cbsd08:40
gnawaHello, I'm trying to load user-data and meta-data expanding dmi variables as seen in the manual --> https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html15:23
gnawathe oly useful variables fouynd in /sys/class/dmi/id are product_serial and product_uuid15:24
gnawabut I can't see any corrispondence with the variables llisted in the table..15:24
gnawaI tried __dmi.system-uuid__  --> product_uuid15:25
gnawaand __dmi.system-serial-number__ --> product_serial15:28
gnawabut it didn't worked..15:28
gnawaah I also tried to use __dmi.chassis-serial-number__ --> chassis_serial15:29
gnawais there anyone who can help me ? thank you (sorry for the typos I burnt two fingers in a pitfire yesterday..)15:31
gnawathe cloud-init log shows: 2023-01-01 15:37:26,739 - DataSourceNoCloud.py[DEBUG]: Seed from http://pxe.gnawa.lan/pxelinux.cfg/__dmi.chassis-serial-number__/ not supported by DataSourceNoCloud [seed=None][dsmode=net]15:45
gnawaand my PXE config stanza is like:15:46
gnawaappend url=http://pxe.gnawa.lan/images/ubuntu-22.04.1-live-server-amd64.iso autoinstall ds=nocloud-net;s=http://pxe.gnawa.lan/pxelinux.cfg/__dmi.chassis-serial-number__/ cloud-config-url=/dev/null ip=dhcp fsck.mode=skip ---15:46
gnawamm okay it looks like the corrispondences between cloud-init variables and dmi values present in /sys/class/dmi/id are correct... as shown by the source code of dmi.py16:04
gnawa"system-uuid": KernelNames("product_uuid", "smbios.system.uuid"),16:05
gnawa    "system-serial-number": KernelNames("product_serial", "smbios.system.serial")16:06
gnawa"chassis-serial-number": KernelNames( "chassis_serial", "smbios.chassis.serial"16:06
meenayou're looking at very fresh, unreleased code 16:22
meenagnawa: unless you're actually running git HEAD, please go look at the corresponding tag for the code causing trouble16:22
gnawathank you meena , where I can find the tag ? I know only the version ov cloud-init:16:25
gnawaroot@ubuntu-server:/var/log# cloud-init --version16:25
gnawausr/bin/cloud-init 22.2-0ubuntu1~22.04.316:26
gnawaoh okay the release tag16:27
gnawanow I see it16:27
minimalgnawa: what version fo cloud-init are you using?17:00
gnawacloud-init 22.2-0ubuntu1~22.04.317:01
minimalgnawa: the dmi variable support was only recently added to git main, it is not present in any release yet17:01
minimalso this functionality will appear in cloud-init 23.1 whenever it is released around February/March time17:03
gnawaok got it, thank you!17:07
minimalgnawa: so the document for the version you are running is~: https://cloudinit.readthedocs.io/en/22.2/topics/datasources/nocloud.html17:07
minimalthe documentation site defaults to "latest" which reflects the git "main~" branch, you need to select the version you are using to see its dos17:08
gnawathank you minimal, I understand my mistake ...17:13
minimalgnawa: you weren't the person trying the same dmi stuff on Alpine Linux a few days ago?17:31
gnawaminimal no it wasn't  me17:32
minimalah ok, they asked the same question but don't seem to have come back to see if anyone answered17:33
minimalmeena: I'm seeing test failures when I enable freebsd for the modified cc_ca_certs.py that I have here - but the failures are unrelated to any certificate stuff, when the test harness "get_cloud" function (in tests/unittests/util.py) is called for "freebsd" it ends up trying to do a "ifconfig -a" for some reason - seems to be related to cloudinit/distros/networking class BSDNetworking being called17:46
meenaaye, i haven't mocked away all of those yet17:57
meenaminimal: my ifconfig parser gets initialised in BSDNetworking, which gets instantiated in FreeBSD distro class. that instantiation calls ifconfig -a17:58
minimalmeena: yes, so for my revised cc_ca_Certs.py its tests are failing due to an unexpected subp for "ifconfig -a"18:00
meenayou can mock it with an empty string, since you don't care about networking paths18:02
-ubottu:#cloud-init- Pull 1779 in canonical/cloud-init "Net: add BSD ifconfig(8) parser and state class" [Merged]18:03
meenahowever, i think i have examples there doing only the initialisation with an empty string18:04
minimalsome of those testcases do use/check subp for certs purposes so I'd need to change those to also expects "ifconfig -a" for freebsd18:04
meenasee with mock18:06
minimale.g. some testcases when testing freebsd will expect to see a subp for "certctl"18:06
meenathat's usually where the instantiation happens18:06
meenahave not figured out yet, how to do that in python18:08
minimalso for example the 1st test to fail is TestConfig.test_correct_order_for_remove_then_add in tests/unittests/config/test_cc_ca_certs.py18:10
minimaltox shows AssertionError: Unexpectedly used subp.subp18:11
minimalthat testcase does nothing with subp at all18:11
meenathat's annoying, let's see how to best fix it18:22
meenahttps://github.com/canonical/cloud-init/blob/main/tests/unittests/config/test_cc_ca_certs.py#L169 in here, i'd do:18:24
meenathis: https://github.com/canonical/cloud-init/blob/main/tests/unittests/config/test_cc_power_state_change.py#L89 18:25
meenaminimal: that make sense? 18:26
minimalok, let me try that18:33
meenathe basic idea is: if it's network related, load in the appropriate ifconfig asset, if not, load ''18:38
minimalok, that seems to have done it, I added this:18:54
minimal+            if distro_name == 'freebsd':18:54
minimal+                mock.patch(18:54
minimal+                    "cloudinit.distros.networking.subp.subp",18:54
minimal+                    return_value=("", None),18:54
minimal+                )18:54
meenano with mock.patch? hmm, yeah, i guess18:56
minimalthat's using mock.patch18:58
meenaI might see if any of the mocks i added need the "with" 18:59
meenaminimal: su what's your patch look like? 20:31
minimalmeena: patch to fix the freebsd issue or the patch in general?20:57
meenaminimal: general22:28
minimalmeena: it's quite a few changes, fixing alpine/debian/ubuntu behaviour as it wasn't correct, likely fixing/changing rhel behaviour and adding freebsd support22:36
minimalI'm currently testing it locally for alpine, then have to run a fedora VM to verify that22:37

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