[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/372893 -- Your team cloud-init Commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Chad Smith has proposed merging ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. Commit message: New upstream snapshot for release into Bionic Requested reviews: cloud-init Commiters (cloud-init-dev) Related bugs: Bug #1844191 in cloud-init: "azure advanced networking sometimes triggers duplicate mac detection" https://bugs.launchpad.net/cloud-init/+bug/1844191 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/372893 -- Your team cloud-init Commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. diff --git a/.gitignore b/.gitignore index 80c509e..b9b98e7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,14 @@ stage *.snap *.cover .idea/ + +# Ignore packaging artifacts +cloud-init.dsc +cloud-init_*.build +cloud-init_*.buildinfo +cloud-init_*.changes +cloud-init_*.deb +cloud-init_*.dsc +cloud-init_*.orig.tar.gz +cloud-init_*.tar.xz +cloud-init_*.upload diff --git a/Makefile b/Makefile index 4ace227..2c6d0c8 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,9 @@ deb-src: echo sudo apt-get install devscripts; exit 1; } $(PYVER) ./packages/bddeb -S -d +doc: + tox -e doc .PHONY: test pyflakes pyflakes3 clean pep8 rpm srpm deb deb-src yaml .PHONY: check_version pip-test-requirements pip-requirements clean_pyc -.PHONY: unittest unittest3 style-check +.PHONY: unittest unittest3 style-check doc diff --git a/cloudinit/atomic_helper.py b/cloudinit/atomic_helper.py index 587b994..1f61faa 100644 --- a/cloudinit/atomic_helper.py +++ b/cloudinit/atomic_helper.py @@ -1,11 +1,13 @@ # This file is part of cloud-init. See LICENSE file for license information. import json +import logging import os import stat import tempfile _DEF_PERMS = 0o644 +LOG = logging.getLogger(__name__) def write_file(filename, content, mode=_DEF_PERMS, @@ -23,6 +25,10 @@ def write_file(filename, content, mode=_DEF_PERMS, try: tf = tempfile.NamedTemporaryFile(dir=os.path.dirname(filename), delete=False, mode=omode) +LOG.debug( +"Atomically writing to file %s (via temporary file %s) - %s: [%o]" +" %d bytes/chars", +filename, tf.name, omode, mode, len(content)) tf.write(content) tf.close() os.chmod(tf.name, mode) diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py index ea707c0..5de5c6d 100644 --- a/cloudinit/net/__init__.py +++ b/cloudinit/net/__init__.py @@ -109,6 +109,127 @@ def is_bond(devname): return os.path.exists(sys_dev_path(devname, "bonding")) +def has_master(devname): +return os.path.exists(sys_dev_path(devname, path="master")) + + +def is_netfailover(devname, driver=None): +""" netfailover driver uses 3 nics, master, primary and standby. +this returns True if the device is either the primary or standby +as these devices are to be ignored. +""" +if driver is None: +driver = device_driver(devname) +if is_netfail_primary(devname, driver) or is_netfail_standby(devname, + driver): +return True +return False + + +def get_dev_features(devname): +""" Returns a str from reading /sys/class/net//device/features.""" +features = '' +try: +features = read_sys_net(devname, 'device/features') +except Exception: +pass +return features + + +def has_netfail_standby_feature(devname): +""" Return True if VIRTIO_NET_F_STANDBY bit (62) is set. + +https://github.com/torvalds/linux/blob/ \ +089cf7f6ecb266b6a4164919a2e69bd2f938374a/ \ +include/uapi/linux/virtio_net.h#L60 +""" +features = get_dev_features(devname) +if not features or len(features) < 64: +return False +return features[62] == "1" + + +def is_netfail_master(devname, driver=None): +""" A device is a "netfail master" device if: + +- The device does NOT have the 'master' sysfs attribute +- The device driver is 'virtio_net' +- The device has the standby feature bit set + +Return True if all of the above is True. +""" +if has_master(devname): +return False + +if driver is None: +driver = device_driver(devname) + +if driver != "virtio_net": +return False + +if not has_netfail_standby_feature(devname): +return False + +return True + + +def is_netfail_primary(devname, driver=None): +""" A device is a "netfail primary" device if: + +- the device has a 'master' sysfs file +- the device driver is not 'virtio_net' +- the 'master' sysfs file points to device with virtio_net driver +- the 'master' device has the 'standby' feature bit set + +Return True if all of the above is True. +""" +# /sys/class/net//master -> ../../ +master_sysfs_path =
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371962 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Needs Fixing continuous-integration FAILED: Continuous integration, rev:22acf15e71e8665fa485a2ef6fe01da9cd2cfd1f https://jenkins.ubuntu.com/server/job/cloud-init-ci/1090/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests FAILED: Ubuntu LTS: Build Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/1090//rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371962 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:ef4aa258cb508c9be6343fcbefa0735066f4ad21 https://jenkins.ubuntu.com/server/job/cloud-init-ci/1076/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/1076//rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371686 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Commit message changed to: Upstream snapshot for SRU into bionic Also enables Exoscale in debian/cloud-init.templates For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371686 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:5b00861163e6cdee18805b11796b60ee76e8c60b https://jenkins.ubuntu.com/server/job/cloud-init-ci/1073/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/1073//rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371686 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:5463fec28e79740fff2382c504f94756a6eda6e2 https://jenkins.ubuntu.com/server/job/cloud-init-ci/1071/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/1071//rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371686 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:01cf9304e4d697c7db9db48e374b31cb50bd https://jenkins.ubuntu.com/server/job/cloud-init-ci/722/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/722/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/367302 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Commit message changed to: New upstream snapshot for SRU into bionic only operation out of the norm here is adding a quilt patch to revert changes to ubuntu-advantage cloud-config module because ubuntu-advantage-tools 19.1 hasn't yet been SRUd to bionic LP: #1828641 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/367302 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:c889e71f058c643ed8c1c0e8cba6966d8f6e6535 https://jenkins.ubuntu.com/server/job/cloud-init-ci/552/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/552/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362365 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Chad Smith has proposed merging ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. Commit message: new upstream snapshot to pull in intermittent unittest fix for OpenNebula for SRU into bionic. Requested reviews: cloud-init commiters (cloud-init-dev) Related bugs: Bug #1799540 in cloud-init: "ONBOOT not supported in SUSE distros" https://bugs.launchpad.net/cloud-init/+bug/1799540 Bug #1813641 in cloud-init: "cloud-init on Disco, opennebula will intermittently fail unittests " https://bugs.launchpad.net/cloud-init/+bug/1813641 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362365 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py index edee01e..28c79b8 100644 --- a/cloudinit/config/cc_rh_subscription.py +++ b/cloudinit/config/cc_rh_subscription.py @@ -249,14 +249,14 @@ class SubscriptionManager(object): except util.ProcessExecutionError as e: if e.stdout.rstrip() != '': for line in e.stdout.split("\n"): -if line is not '': +if line != '': self.log_warn(line) else: self.log_warn("Setting the service level failed with: " "{0}".format(e.stderr.strip())) return False for line in return_out.split("\n"): -if line is not "": +if line != "": self.log.debug(line) return True @@ -268,7 +268,7 @@ class SubscriptionManager(object): self.log_warn("Auto-attach failed with: {0}".format(e)) return False for line in return_out.split("\n"): -if line is not "": +if line != "": self.log.debug(line) return True diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index fd8e501..19b3e60 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -273,6 +273,7 @@ class Renderer(renderer.Renderer): ('USERCTL', False), ('NM_CONTROLLED', False), ('BOOTPROTO', 'none'), +('STARTMODE', 'auto'), ]) # If these keys exist, then their values will be used to form @@ -367,6 +368,7 @@ class Renderer(renderer.Renderer): iface_cfg.name)) if subnet.get('control') == 'manual': iface_cfg['ONBOOT'] = False +iface_cfg['STARTMODE'] = 'manual' # set IPv4 and IPv6 static addresses ipv4_index = -1 diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py index 6e1d04b..02c9a7b 100644 --- a/cloudinit/sources/DataSourceOpenNebula.py +++ b/cloudinit/sources/DataSourceOpenNebula.py @@ -337,7 +337,9 @@ def parse_shell_config(content, keylist=None, bash=None, asuser=None, (output, _error) = util.subp(cmd, data=bcmd) # exclude vars in bash that change on their own or that we used -excluded = ("EPOCHREALTIME", "RANDOM", "LINENO", "SECONDS", "_", "__v") +excluded = ( +"EPOCHREALTIME", "EPOCHSECONDS", "RANDOM", "LINENO", "SECONDS", "_", +"__v") preset = {} ret = {} target = None diff --git a/debian/changelog b/debian/changelog index e611ee7..efc0567 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,18 @@ -cloud-init (18.5-17-gd1a2fe73-0ubuntu1~18.04.1) bionic; urgency=medium +cloud-init (18.5-21-g8ee294d5-0ubuntu1~18.04.1) bionic; urgency=medium * New upstream snapshot. (LP: #1813346) +- opennebula: also exclude epochseconds from changed environment vars +- systemd: Render generator from template to account for system + differences. [Robert Schweikert] +- sysconfig: On SUSE, use STARTMODE instead of ONBOOT [Robert Schweikert] +- flake8: use ==/!= to compare str, bytes, and int literals + [Paride Legovini] + + -- Chad Smith Mon, 28 Jan 2019 20:25:39 -0700 + +cloud-init (18.5-17-gd1a2fe73-0ubuntu1~18.04.1) bionic; urgency=medium + + * New upstream snapshot. - opennebula: exclude EPOCHREALTIME as known bash env variable with a delta - tox: fix disco httpretty dependencies for py37 - run-container: uncomment baseurl in yum.repos.d/*.repo when using a diff --git a/setup.py b/setup.py index ea37efc..186e215 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,8 @@ VARIANT = None def is_f(p): return os.path.isfile(p) +def is_generator(p): +return '-generator' in p def tiny_p(cmd, capture=True): # Darn python 2.6 doesn't have check_output (ar) @@ -90,7 +92,7 @@ def read_requires(): return str(deps).splitlines() -def render_tmpl(template): +def render_tmpl(template, mode=None): """render template
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362281 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:4a1aaa18595fa663e1a38dd3ac8f73231ec69a7f https://jenkins.ubuntu.com/server/job/cloud-init-ci/543/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/543/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362281 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Commit message changed to: sync new-upstream-snapshot for release into bionic For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362279 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Chad Smith has proposed merging ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. Commit message: New upstream snapshot for release into bionic through sru Requested reviews: cloud-init commiters (cloud-init-dev) For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362276 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Rejecting as we'll really just fix cloud-init query to look fallback to the original instance-data.json if instance-data-sensitive.json doesn't exist and print a sensible warning message. Diff comments: > diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst > index f88d1c5..11ae75b 100644 > --- a/debian/cloud-init.postinst > +++ b/debian/cloud-init.postinst > @@ -206,6 +206,20 @@ cleanup_lp1552999() { > "$edir/cloud-init-local.service" "$edir/cloud-init.service" > } > > +# Old instance-data.json was root read-only, new is redacted world-readable > +# Also add instance-data-sensitive.json that is root read-only > +regenerate_instance_data_json_on_upgrade() { > +if [ -f /run/cloud-init/instance-data.json -a > + ! -f /run/cloud-init/instance-data-sensitive.json ]; then > +# this is an upgraded system with old instance-data.json file > +echo "Updating /run/cloud-init/instance-data.json" > +python3 -c ' > +from cloudinit.stages import _pkl_load > +pickled_ds = _pkl_load("/var/lib/cloud/instance/obj.pkl") > +pickled_ds.persist_instance_data()' I'll add a RELEASE_NOTE comment in cloudinit.stages._obj_pkl so that we check ubuntu/{series} branches if we change the behavior. > +fi > +} > + > disable_network_config_on_upgrade() { > local oldver="$1" last_without_net="0.7.7~bzr1182-0ubuntu1" > if [ ! -f /var/lib/cloud/instance/obj.pkl ]; then -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Rejected For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
thoughts? Diff comments: > diff --git a/debian/changelog b/debian/changelog > index 2bb9520..d83e08b 100644 > --- a/debian/changelog > +++ b/debian/changelog > @@ -1,3 +1,10 @@ > +cloud-init (18.4-0ubuntu1~18.04.2) bionic-proposed; urgency=medium can you change that to be 'bionic' not bionic-proposed. then we can upload straight away to a ppa with no hackery or fighting dput-ng. > + > + * debian/cloud-init.postinst: Rewrite /run/cloud-init/instance-data.json > +on upgrade. (LP: #1798189) > + > + -- Chad Smith Wed, 16 Oct 2018 21:30:45 -0600 > + > cloud-init (18.4-0ubuntu1~18.04.1) bionic-proposed; urgency=medium > >* drop the following cherry-picks now included: > diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst > index f88d1c5..11ae75b 100644 > --- a/debian/cloud-init.postinst > +++ b/debian/cloud-init.postinst > @@ -206,6 +206,20 @@ cleanup_lp1552999() { > "$edir/cloud-init-local.service" "$edir/cloud-init.service" > } > > +# Old instance-data.json was root read-only, new is redacted world-readable > +# Also add instance-data-sensitive.json that is root read-only > +regenerate_instance_data_json_on_upgrade() { > +if [ -f /run/cloud-init/instance-data.json -a > + ! -f /run/cloud-init/instance-data-sensitive.json ]; then > +# this is an upgraded system with old instance-data.json file > +echo "Updating /run/cloud-init/instance-data.json" > +python3 -c ' > +from cloudinit.stages import _pkl_load > +pickled_ds = _pkl_load("/var/lib/cloud/instance/obj.pkl") > +pickled_ds.persist_instance_data()' my only issue is that how are we ever going to remember in upstream that ubuntu does this set of function calls? we can/should also check that the version being upgraded from is older than one that should have written this stuff. if dpkg --compare-versions "$oldver" ... > +fi > +} > + > disable_network_config_on_upgrade() { > local oldver="$1" last_without_net="0.7.7~bzr1182-0ubuntu1" > if [ ! -f /var/lib/cloud/instance/obj.pkl ]; then -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:7bce4f1523d7737c159e7c185c0e9e20ea8bdbf6 https://jenkins.ubuntu.com/server/job/cloud-init-ci/399/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/399/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Commit message changed to: Patch ubuntu debian/cloud-init.postinst to rewrite /run/cloud-init/instance-data*.json on upgrade LP: #1798189 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Chad Smith has proposed merging ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. Commit message: Patch ubuntu debian/cloud-init.postinst to rewrite /run/cloud-init/instance-data*.json on upgrade LP: #1798189 Requested reviews: cloud-init commiters (cloud-init-dev) Related bugs: Bug #1798189 in cloud-init: "cloud-init query: /run/cloud/instance-data-sensitive.json not generated on upgrade" https://bugs.launchpad.net/cloud-init/+bug/1798189 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/356897 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. diff --git a/debian/changelog b/debian/changelog index 2bb9520..d83e08b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +cloud-init (18.4-0ubuntu1~18.04.2) bionic-proposed; urgency=medium + + * debian/cloud-init.postinst: Rewrite /run/cloud-init/instance-data.json +on upgrade. (LP: #1798189) + + -- Chad Smith Wed, 16 Oct 2018 21:30:45 -0600 + cloud-init (18.4-0ubuntu1~18.04.1) bionic-proposed; urgency=medium * drop the following cherry-picks now included: diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst index f88d1c5..11ae75b 100644 --- a/debian/cloud-init.postinst +++ b/debian/cloud-init.postinst @@ -206,6 +206,20 @@ cleanup_lp1552999() { "$edir/cloud-init-local.service" "$edir/cloud-init.service" } +# Old instance-data.json was root read-only, new is redacted world-readable +# Also add instance-data-sensitive.json that is root read-only +regenerate_instance_data_json_on_upgrade() { +if [ -f /run/cloud-init/instance-data.json -a + ! -f /run/cloud-init/instance-data-sensitive.json ]; then +# this is an upgraded system with old instance-data.json file +echo "Updating /run/cloud-init/instance-data.json" +python3 -c ' +from cloudinit.stages import _pkl_load +pickled_ds = _pkl_load("/var/lib/cloud/instance/obj.pkl") +pickled_ds.persist_instance_data()' +fi +} + disable_network_config_on_upgrade() { local oldver="$1" last_without_net="0.7.7~bzr1182-0ubuntu1" if [ ! -f /var/lib/cloud/instance/obj.pkl ]; then @@ -323,6 +337,8 @@ EOF # make upgrades disable network changes by cloud-init disable_network_config_on_upgrade "$2" + regenerate_instance_data_json_on_upgrade + fix_azure_upgrade_1611074 "$2" cleanup_ureadahead "$2" ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/351926 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:f03dfdebfe700c038a90452ecc23ed8840dea7d4 https://jenkins.ubuntu.com/server/job/cloud-init-ci/180/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/180/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/351926 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Chad Smith has proposed merging ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. Commit message: Cherry pick fix for Oracle cloud detection for release into Bionic LP: #1784685 Requested reviews: cloud-init commiters (cloud-init-dev) Related bugs: Bug #1784685 in cloud-init: "Oracle: cloud-init openstack local detection too strict for oracle cloud" https://bugs.launchpad.net/cloud-init/+bug/1784685 For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/351926 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. diff --git a/debian/changelog b/debian/changelog index 1c52e93..6121991 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +cloud-init (18.3-9-g2e62cb8a-0ubuntu1~18.04.2) bionic-proposed; urgency=medium + + * cherry-pick 3cee0bf8: oracle: fix detect_openstack to report True on +(LP: #1784685) + + -- Chad Smith Tue, 31 Jul 2018 12:58:16 -0600 + cloud-init (18.3-9-g2e62cb8a-0ubuntu1~18.04.1) bionic-proposed; urgency=medium * New upstream snapshot. (LP: #1777912) diff --git a/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on b/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on new file mode 100644 index 000..ea29c34 --- /dev/null +++ b/debian/patches/cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on @@ -0,0 +1,66 @@ +From 3cee0bf85fbf12d272422c8eeed63bf06e64570b Mon Sep 17 00:00:00 2001 +From: Chad Smith +Date: Tue, 31 Jul 2018 18:44:12 + +Subject: [PATCH] oracle: fix detect_openstack to report True on + OracleCloud.com DMI data + +The OpenStack datasource in 18.3 changed to detect data in the +init-local stage instead of init-network and attempted to redetect +OpenStackLocal datasource on Oracle across reboots. The function +detect_openstack was added to quickly detect whether a platform is +OpenStack based on dmi product_name or chassis_asset_tag and it was +a bit too strict for Oracle in checking for 'OpenStack Nova'/'Compute' +DMI product_name. + +Oracle's DMI product_name reports 'SAtandard PC (i440FX + PIIX, 1996)' +and DMI chassis_asset_tag is 'OracleCloud.com'. + +detect_openstack function now adds 'OracleCloud.com' as a supported value +'OracleCloud.com' to valid chassis-asset-tags for the OpenStack +datasource. + +LP: #1784685 +--- + cloudinit/sources/DataSourceOpenStack.py | 3 ++- + tests/unittests/test_datasource/test_openstack.py | 18 ++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +--- a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py +@@ -28,7 +28,8 @@ DMI_PRODUCT_NOVA = 'OpenStack Nova' + DMI_PRODUCT_COMPUTE = 'OpenStack Compute' + VALID_DMI_PRODUCT_NAMES = [DMI_PRODUCT_NOVA, DMI_PRODUCT_COMPUTE] + DMI_ASSET_TAG_OPENTELEKOM = 'OpenTelekomCloud' +-VALID_DMI_ASSET_TAGS = [DMI_ASSET_TAG_OPENTELEKOM] ++DMI_ASSET_TAG_ORACLE_CLOUD = 'OracleCloud.com' ++VALID_DMI_ASSET_TAGS = [DMI_ASSET_TAG_OPENTELEKOM, DMI_ASSET_TAG_ORACLE_CLOUD] + + + class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): +--- a/tests/unittests/test_datasource/test_openstack.py b/tests/unittests/test_datasource/test_openstack.py +@@ -511,6 +511,24 @@ class TestDetectOpenStack(test_helpers.C + ds.detect_openstack(), + 'Expected detect_openstack == True on OpenTelekomCloud') + ++@test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data') ++def test_detect_openstack_oraclecloud_chassis_asset_tag(self, m_dmi, ++m_is_x86): ++"""Return True on OpenStack reporting Oracle cloud asset-tag.""" ++m_is_x86.return_value = True ++ ++def fake_dmi_read(dmi_key): ++if dmi_key == 'system-product-name': ++return 'Standard PC (i440FX + PIIX, 1996)' # No match ++if dmi_key == 'chassis-asset-tag': ++return 'OracleCloud.com' ++assert False, 'Unexpected dmi read of %s' % dmi_key ++ ++m_dmi.side_effect = fake_dmi_read ++self.assertTrue( ++ds.detect_openstack(), ++'Expected detect_openstack == True on OracleCloud.com') ++ + @test_helpers.mock.patch(MOCK_PATH + 'util.get_proc_env') + @test_helpers.mock.patch(MOCK_PATH + 'util.read_dmi_data') + def test_detect_openstack_by_proc_1_environ(self, m_dmi, m_proc_env, diff --git a/debian/patches/series b/debian/patches/series index 2ce72fb..3691601 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ openstack-no-network-config.patch +cpick-3cee0bf8-oracle-fix-detect_openstack-to-report-True-on ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe :
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/348362 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:d39e24e74c4f0486ceb9aa4a1db77c7a537db996 https://jenkins.ubuntu.com/server/job/cloud-init-ci/120/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/120/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/348362 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
[Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
The proposal to merge ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/348355 -- Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:21064462ea41b0d3d193108fe4019c708f3bb0a6 https://jenkins.ubuntu.com/server/job/cloud-init-ci/116/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/116/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/348355 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp
Re: [Cloud-init-dev] [Merge] ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic
Review: Approve continuous-integration PASSED: Continuous integration, rev:ff8bc0d8da2d5d4447664bb48ee90b4b8085a3a6 https://jenkins.ubuntu.com/server/job/cloud-init-ci/110/ Executed test runs: SUCCESS: Checkout SUCCESS: Unit & Style Tests SUCCESS: Ubuntu LTS: Build SUCCESS: Ubuntu LTS: Integration SUCCESS: MAAS Compatability Testing IN_PROGRESS: Declarative: Post Actions Click here to trigger a rebuild: https://jenkins.ubuntu.com/server/job/cloud-init-ci/110/rebuild -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/348311 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:ubuntu/bionic into cloud-init:ubuntu/bionic. ___ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp