cloud-init team mailing list archive
-
cloud-init team
-
Mailing list archive
-
Message #00216
Nocloud data source and network-config
-
To:
cloud-init@xxxxxxxxxxxxxxxxxxx
-
From:
Conrad Hoffmann <ch@xxxxxxxxxxxxx>
-
Date:
Wed, 3 Jul 2019 10:02:35 +0200
-
Autocrypt:
addr=ch@xxxxxxxxxxxxx; keydata= mQINBEtokCYBEAC9TK9ye78GwILDVQ70P7ji9LHBR5ozL4FGLi0tH0pSSuhJjZcY0UDfrr+l cjw2ap2ZM7Aio7H3b6eC2vXUp1iR0Hcstx0YfAuGDhsa2Dx32nRpBHDibN1nzNKJZOEzEtbO TRbx8w1FnLXiNt7x+vEipm4xCxkigfq/YEjtY/b0Xmaqs/1JiEytkdmvLwJ8fEm8evyz37Xw hJNyXQEKLDD/Qhio2o86nbxSyxxA/C+oUlBLM8W7Oh+SLyMrbyQiLAbVRUHOduOuRlyNMUcJ OL5KmwJ1neddI1/qZ94M663k0Qnv1EaVfDGCSXDMkcgrXLhNY134Ytdx+OquOejPN0u46Bv0 Qxy3tDqfnatBPufsspuIiKxnRxNNLE6fyw97lpq4yMl/v5FXpf42xjhwOoXwu4umc0aoMo1C hgnnRKN1qx/rhLDu8YFa1LGvNtrPXQpt2YvTTE7aXFvdgug58RMH4RL5bfWWGLEEB0s2fIdp 4J6uw3+8KMT+TfbiNfZdsOiXAH4YK8zTlRcm4VkxxEFZXeH6wPyOX/wpqYurNhmpaUkoBr0M 7hwM/ah/iUsz36dKA5zt0XYMSwR/zS9d1aChxIIQ3bVUSMdvHrIKMDKhaq82WgAekqDsr72h Zg2nQy1GecRl5k1HfPvmu5oBFpX/U6vINqgSRdb/QR2QuHeqxQARAQABtCJDb25yYWQgSG9m Zm1hbm4gPGNoQGJpdGZlaGxlci5uZXQ+iQJVBBMBAgA/AhsDBgsJCAcDAgYVCAIJCgsEFgID AQIeAQIXgBYhBIZrAugrJbk3eKpBOJL7pBujbE02BQJbpV2MBQkT/zRmAAoJEJL7pBujbE02 u0YP/0B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
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2
Hi there!
I was attempting to use the nocloud data source with a custom seed dir
including a network-config, but this did not seem to work. I think
others may have had the same problem [1][2], so I decided to look into it.
Just looking at the code path, the issue is rather obvious: when
specifying e.g. `ds=nocloud;s=/` on the command line, cloud-init will
use `util.read_seeded` [3] on that, which simply never looks for a
network-config.
As a first test, I replaced the call to `read_seeded` with one to
`pathprefix2dict` alread used elsewhere in the data source. You can see
the diff here [4]. This works for me, but I know this is not a solution:
it would break the nocloud-net data source, as `pathprefix2dict` only
operates on local files, whereas `read_seeded` handles URLs as well.
Now, I will admit, I am not sure I have really understood the greater
scheme of things with the various loading and merging of dicts in the
nocloud datasource, but my guess would be that `read_seeded` (and in
fact it's companion `read_optional_seed`) can be considered deprecated,
as they do not handle network-config and their function signature does
not allow adding that without touching all callers. Instead, I thought
it might make sense to support URLs in `pathprefix2dict`?
I'd be very happy to supply patches for this if someone can confirm that
it makes sense or can point out a more appropriate approach.
Thanks a lot for keeping all the clouds running,
Conrad
[1] https://bugs.launchpad.net/cloud-init/+bug/1809180
[2] https://lists.launchpad.net/cloud-init/msg00188.html
[3]
https://git.launchpad.net/cloud-init/tree/cloudinit/sources/DataSourceNoCloud.py#n168
[4]
https://git.launchpad.net/~bitfehler/cloud-init/commit/?id=0735b3ea5489869b29fa50123564d45b4cdca6ca
Follow ups