When provisioning Fedora 25 and 26 Atomic, it fails to setup networking due to: This is caused by line 423, which calls util.write incorrectly: util.write_file(nm_conf_path, nm_conf_content, file_mode) The third parameter of "file_mode" appears to be a backport, since it appears in the current upstream trunk. Potential fix: --- /usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/sysconfig.py 2017-06-27 12:36:47.455379873 +0000 @@ -420,7 +420,7 @@ self.networkmanager_conf_path) nm_conf_content = self._render_networkmanager_conf(network_state) if nm_conf_content: - util.write_file(nm_conf_path, nm_conf_content, file_mode) + util.write_file(nm_conf_path, nm_conf_content) if self.netrules_path: netrules_content = self._render_persistent_net(network_state) netrules_path = os.path.join(target, self.netrules_path)
That appears to be a mis-applied backport. The changes to write_file were implemented in https://git.launchpad.net/cloud-init/commit/?id=721348a6 to resolve https://bugzilla.redhat.com/show_bug.cgi?id=1295984. I think that the fix in the description here is incorrect; rather, the Fedora package should probably carry 721348a6 as well.
Actually, I lied. The support for the mode parameter has been around forever. Going back to 0.7.5, write_file looks like: def write_file(filename, content, mode=0644, omode="wb"): Which is fine. So actually, I don't see any problem here. Are you seeing some sort of failure? Could you post the error/traceback? Thanks!
Here is the traceback he sent me earlier: ``` Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 513, in status_wrapper ret = functor(name, args) File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 269, in main_init init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL)) File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 641, in apply_network_config return self.distro.apply_network_config(netcfg, bring_up=bring_up) File "/usr/lib/python3.6/site-packages/cloudinit/distros/__init__.py", line 150, in apply_network_config dev_names = self._write_network_config(netconfig) File "/usr/lib/python3.6/site-packages/cloudinit/distros/rhel.py", line 60, in _write_network_config self._net_renderer.render_network_state("/", ns) File "/usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py", line 423, in render_network_state util.write_file(nm_conf_path, nm_conf_content, file_mode) NameError: name 'file_mode' is not defined ```
Okay, so, still a mis-applied backport. The file_mode variable should be defined at the top of render_network_state. That was introduced in ef18b8ac4cf7e3dfd98830fbdb298380a192a0fc.
cloud-init-0.7.9-7.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-faae58b0d0
F26 update: https://bodhi.fedoraproject.org/updates/cloud-init-0.7.9-7.fc26
cloud-init-0.7.9-7.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a687a6d05c
cloud-init-0.7.9-7.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-faae58b0d0
images that can be used to verify the fix for this bug: https://dustymabe.fedorapeople.org/cloud-base-cloud-init-0.7.9-7.qcow2 https://dustymabe.fedorapeople.org/atomic-host-cloud-init-0.7.9-7.qcow2
Proposed as a Freeze Exception for 26-final by Fedora user dustymabe using the blocker tracking app because: This fixes an issue with static networking configuration in cloud-init. Our DigitalOcean images use this in order to configure network. Please allow it as a freeze exception.
Images posted in Comment #10 still have the previous version of Cloud-init: # rpm -qa cloud-init cloud-init-0.7.9-6.fc26.noarch /var/log/cloud-init.log 2017-06-29 12:26:26,021 - util.py[DEBUG]: failed stage init-local Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 513, in status_wrapper ret = functor(name, args) File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 269, in main_init init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL)) File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 641, in apply_network_config return self.distro.apply_network_config(netcfg, bring_up=bring_up) File "/usr/lib/python3.6/site-packages/cloudinit/distros/__init__.py", line 150, in apply_network_config dev_names = self._write_network_config(netconfig) File "/usr/lib/python3.6/site-packages/cloudinit/distros/rhel.py", line 60, in _write_network_config self._net_renderer.render_network_state("/", ns) File "/usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py", line 423, in render_network_state util.write_file(nm_conf_path, nm_conf_content, file_mode) NameError: name 'file_mode' is not defined
ok the cloud base image did not have the new cloud-init. The atomic image was good. Can you re-download the cloud-base image and verify your images match: ``` $ md5sum atomic-host-cloud-init-0.7.9-7.qcow2 cloud-base-cloud-init-0.7.9-7.qcow2 50c418f240b04ef7ceaa6e933d0de628 atomic-host-cloud-init-0.7.9-7.qcow2 e56b3b64a2b1bd3a569afe7f90a2b62a cloud-base-cloud-init-0.7.9-7.qcow2 ```
Discussed at 2017-06-29 freeze exception review meeting: https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2017-06-29/f26-blocker-review.2017-06-29-16.00.html . Accepted as a freeze exception as a significant issue which can't be fully fixed with a post-release update.
cloud-init-0.7.9-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.
cloud-init-0.7.9-9.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-5507234819
cloud-init-0.7.9-9.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-5507234819
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.