Comment 4 for bug 1660385

Scott Moser (smoser) wrote :

$ cat /var/lib/cloud/data/result.json
{
 "v1": {
  "datasource": "DataSourceOpenStack [net,ver=2]",
  "errors": []
 }
}
$ cat /etc/cloud/build.info
build_name: server
serial: 20170303.1
$ lsb_release -sc
xenial

$ mkdir old; sudo mv /run/cloud-init/ /var/log/cloud-init* /var/lib/cloud/ old

$ grep Looking /var/log/cloud-init.log
2017-03-08 22:32:23,269 - __init__.py[DEBUG]: Looking for for data source in: ['NoCloud', 'ConfigDrive', 'OpenNebula', 'DigitalOcean', 'Azure', 'AltCloud', 'OVF', 'MAAS', 'GCE', 'OpenStack', 'CloudSigma', 'SmartOS', 'Ec2', 'CloudStack', 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM']
2017-03-08 22:32:25,334 - __init__.py[DEBUG]: Looking for for data source in: ['NoCloud', 'ConfigDrive', 'OpenNebula', 'DigitalOcean', 'Azure', 'AltCloud', 'OVF', 'MAAS', 'GCE', 'OpenStack', 'CloudSigma', 'SmartOS', 'Ec2', 'CloudStack', 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']

$ rel=$(lsb_release -sc)
$ line=$(awk '$1 == "deb" && $2 ~ /ubuntu.com/ { printf("%s %s %s-proposed main universe\n", $1, $2, rel); exit(0) }; ' "rel=$rel" /etc/apt/sources.list)
$ echo "$line" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt-get update -q && sudo apt-get install -q cloud-init
$ dpkg-query --show cloud-init
cloud-init 0.7.9-48-g1c795b9-0ubuntu1~16.04.1

$ sudo dpkg-reconfigure cloud-init
Leaving 'diversion of /etc/init/ureadahead.conf to /etc/init/ureadahead.conf.disabled by cloud-init'
$ cat /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# to update this file, run dpkg-reconfigure cloud-init
datasource_list: [ Ec2, None ]

$ sudo rm -Rf /var/lib/cloud /var/log/cloud-init* /run/cloud-init
$ sudo reboot

## See the warning on stderr, instructing how to silence
## set that file up.
$ cat /etc/cloud/cloud.cfg.d/99-ec2-datasource.cfg
#cloud-config
datasource:
 Ec2:
  strict_id: false
$ mkdir old2; sudo mv /run/cloud-init/ /var/log/cloud-init* /var/lib/cloud/ old2

## then ssh back in, no warning shown.
$ grep strict_ /var/log/cloud-init.log
2017-03-08 22:56:03,832 - DataSourceEc2.py[DEBUG]: strict_mode: false, cloud_platform=Unknown