cc_rsyslog.py:205: FutureWarning: Possible nested set at position 23

Bug #1816967 reported by Tommi Rantala on 2019-02-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Low
Dan Watkins

Bug Description

With Python 3.7 this FutureWarning is seen e.g. in VM serial console:

[ 4.321959] cloud-init[728]: /usr/lib/python3.7/site-packages/cloudinit/config/cc_rsyslog.py:205: FutureWarning: Possible nested set at position 23
[ 4.323230] cloud-init[728]: r'^(?P<proto>[@]{0,2})'

I think it's fixable by changing [[] to [\[] in the HOST_PORT_RE regex in cc_rsyslog.py.

https://docs.python.org/dev/whatsnew/3.7.html#re

Related branches

Dan Watkins (daniel-thewatkins) wrote :

Hi Tommi,

Thanks for the bug report! I'm not seeing this in my logs when I launch Ubuntu disco (which has Python 3.7) images. Can you give me some concrete steps to reproduce this issue so we can be sure that any changes we might make will actually fix the issue you're seeing?

Thanks!

Changed in cloud-init:
status: New → Incomplete
Tommi Rantala (tt-rantala) wrote :

Hi,

I can reproduce the warning by launching Ubuntu disco image with the following steps (in fedora 29).

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
wget https://cloud-images.ubuntu.com/disco/20190211/disco-server-cloudimg-amd64.img

cat >my-user-data <<EOF
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF

echo "instance-id: $(uuidgen)" >my-meta-data
cloud-localds my-seed.img my-user-data my-meta-data

qemu-img create -f qcow2 -b disco-server-cloudimg-amd64.img my-disk.qcow2
qemu-system-x86_64 -nographic -enable-kvm -cdrom my-seed.img -hda my-disk.qcow2
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The FutureWarning then seen in the VM serial console output:

...
[ 8.207739] cloud-init[364]: ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
[ 8.212932] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.220609] cloud-init[364]: ci-info: | Route | Destination | Gateway | Interface | Flags |
[ 8.225923] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.231616] cloud-init[364]: ci-info: | 1 | fe80::/64 | :: | ens3 | U |
[ 8.238636] cloud-init[364]: ci-info: | 2 | fec0::/64 | :: | ens3 | Ue |
[ 8.244156] cloud-init[364]: ci-info: | 3 | ::/0 | fe80::2 | ens3 | UGe |
[ 8.247698] cloud-init[364]: ci-info: | 5 | local | :: | ens3 | U |
[ 8.252484] cloud-init[364]: ci-info: | 6 | ff00::/8 | :: | ens3 | U |
[ 8.255744] cloud-init[364]: ci-info: +-------+-------------+---------+-----------+-------+
[ 8.738562] cloud-init[364]: /usr/lib/python3/dist-packages/cloudinit/config/cc_rsyslog.py:205: FutureWarning: Possible nested set at position 23
[ 8.740304] cloud-init[364]: r'^(?P<proto>[@]{0,2})'
[ 8.741799] cloud-init[364]: Generating public/private rsa key pair.
[ 8.745423] cloud-init[364]: Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
[ 8.748589] cloud-init[364]: Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
...

Dan Watkins (daniel-thewatkins) wrote :

Thanks Tommi, I've been able to reproduce this now. (It turns out that launching a lxd container doesn't cause this to be emitted, but launching a cloud instance does.)

Dan Watkins (daniel-thewatkins) wrote :

Is this a fix that you would be interested in submitting as a merge proposal?

Changed in cloud-init:
status: Incomplete → Triaged
importance: Undecided → Low
Tommi Rantala (tt-rantala) wrote :

I didn't plan to submit the fix (I have not signed the Canonical CLA).
So feel free to fix this.

Changed in cloud-init:
assignee: nobody → Dan Watkins (daniel-thewatkins)
status: Triaged → In Progress

This bug is fixed with commit f0f09629 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=f0f09629

Changed in cloud-init:
status: In Progress → Fix Committed

This bug is believed to be fixed in cloud-init in version 19.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers