Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasource.sys_cfg gets different values in local stage and after. #3222

Closed
ubuntu-server-builder opened this issue May 11, 2023 · 4 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1787459

Launchpad details
affected_projects = ['cloud-init (Ubuntu)']
assignee = smoser
assignee_name = Scott Moser
date_closed = 2018-10-02T21:13:00.191510+00:00
date_created = 2018-08-16T18:16:50.791283+00:00
date_fix_committed = 2018-09-20T12:45:06.849634+00:00
date_fix_released = 2018-10-02T21:13:00.191510+00:00
id = 1787459
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1787459
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = smoser
submitter_name = Scott Moser
tags = ['amd64', 'apport-bug', 'cosmic', 'uec-images']
duplicates = []

Launchpad user Scott Moser(smoser) wrote on 2018-08-16T18:16:50.791283+00:00

When a datasource is instantiated it is passed in Init.cfg as the 'sys_cfg'.
But then when 'distro' property is referenced, it has the side effect
of:
system_config = self._extract_cfg('system')

        if self.datasource is not NULL_DATA_SOURCE:
            self.datasource.distro = self._distro
            self.datasource.sys_cfg = system_config

Here we see the problem demonstrated.

root@c1:~# cat show-syscfg-keys
#!/usr/bin/python3
from cloudinit.stages import _pkl_load;
print(_pkl_load("/var/lib/cloud/instance/obj.pkl").sys_cfg.keys())

root@c1:# cloud-init clean --logs
root@c1:
# cloud-init init --local
Cloud-init v. 18.3-18-g3cee0bf8-0ubuntu1 running 'init-local' at Thu, 16 Aug 2018 18:08:00 +0000. Up 574.00 seconds.

root@c1:~# python3 show-syscfg-keys
dict_keys(['datasource_list', '_log', 'log_cfgs', 'output', 'users', 'disable_root', 'preserve_hostname', 'cloud_init_modules', 'cloud_config_modules', 'cloud_final_modules', 'def_log_file', 'syslog_fix_perms', 'vendor_data'])

root@c1:#
root@c1:
#
root@c1:~# cloud-init init >/dev/null 2>&1
Cloud-init v. 18.3-18-g3cee0bf8-0ubuntu1 running 'init' at Thu, 16 Aug 2018 18:08:11 +0000. Up 585.00 seconds.
...

root@c1:~# python3 show-syscfg-keys
dict_keys(['default_user', 'ntp_client', 'paths', 'package_mirrors', 'ssh_svcname', 'network'])

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: cloud-init 18.3-18-g3cee0bf8-0ubuntu1
ProcVersionSignature: Ubuntu 4.17.0-6.7-generic 4.17.9
Uname: Linux 4.17.0-6-generic x86_64
ApportVersion: 2.20.10-0ubuntu7
Architecture: amd64
CloudName: LXD
Date: Thu Aug 16 18:02:03 2018
PackageArchitecture: all
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 11, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2018-08-16T18:16:50.791283+00:00

Launchpad attachments: NonfreeKernelModules.txt,Dependencies.txt,ProcCpuinfoMinimal.txt,cloud-init-output.log.txt.txt,logs.tgz.gz,lshw.txt.txt

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Server Team CI bot(server-team-bot) wrote on 2018-09-20T12:45:04.640006+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2018-10-02T21:13:01.777397+00:00

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

Thank you.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2018-10-03T13:59:14.349799+00:00

This bug was fixed in the package cloud-init - 18.4-0ubuntu1

cloud-init (18.4-0ubuntu1) cosmic; urgency=medium

  • New upstream release.
    • release 18.4 (LP: #1795741)
    • tests: allow skipping an entire cloud_test without running.
    • tests: disable lxd tests on cosmic
    • cii-tests: use unittest2.SkipTest in ntp_chrony due to new deps
    • lxd: adjust to snap installed lxd.
    • docs: surface experimental doc in instance-data.json
    • tests: fix ec2 integration tests. process meta_data instead of meta-data
    • Add support for Infiniband network interfaces (IPoIB). [Mark Goddard]
    • cli: add cloud-init query subcommand to query instance metadata
    • tools/tox-venv: update for new features.
    • pylint: ignore warning assignment-from-no-return for _write_network
    • stages: Fix bug causing datasource to have incorrect sys_cfg.
      (LP: #1787459)
    • Remove dead-code _write_network distro implementations.
    • net_util: ensure static configs have netmask in translate_network result
      [Thomas Berger] (LP: #1792454)
    • Fall back to root:root on syslog permissions if other options fail.
      [Robert Schweikert]
    • tests: Add mock for util.get_hostname. [Robert Schweikert] (LP: #1792799)

-- Chad Smith chad.smith@canonical.com Tue, 02 Oct 2018 19:55:23 -0600

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant