Merge ~smoser/cloud-init:bug/1570325-chpasswd-hashed-passwds into ~tore.lonoy/cloud-init:hashed-chpasswd-support

Proposed by Scott Moser
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: ~smoser/cloud-init:bug/1570325-chpasswd-hashed-passwds
Merge into: ~tore.lonoy/cloud-init:hashed-chpasswd-support
Diff against target: 27550 lines (+14914/-4663) (has conflicts)
465 files modified
.gitignore (+1/-0)
.pylintrc (+39/-0)
ChangeLog (+97/-0)
HACKING.rst (+8/-7)
LICENSE (+22/-674)
LICENSE-Apache2.0 (+202/-0)
LICENSE-GPLv3 (+674/-0)
Makefile (+9/-5)
cloudinit/__init__.py (+0/-21)
cloudinit/atomic_helper.py (+3/-2)
cloudinit/cloud.py (+6/-20)
cloudinit/cmd/__init__.py (+0/-21)
cloudinit/cmd/main.py (+177/-38)
cloudinit/config/__init__.py (+7/-18)
cloudinit/config/cc_apt_configure.py (+10/-20)
cloudinit/config/cc_apt_pipelining.py (+5/-15)
cloudinit/config/cc_bootcmd.py (+8/-18)
cloudinit/config/cc_byobu.py (+7/-17)
cloudinit/config/cc_ca_certs.py (+7/-17)
cloudinit/config/cc_chef.py (+8/-18)
cloudinit/config/cc_debug.py (+4/-14)
cloudinit/config/cc_disable_ec2_metadata.py (+7/-17)
cloudinit/config/cc_disk_setup.py (+14/-24)
cloudinit/config/cc_emit_upstart.py (+7/-17)
cloudinit/config/cc_fan.py (+5/-15)
cloudinit/config/cc_final_message.py (+7/-17)
cloudinit/config/cc_foo.py (+7/-17)
cloudinit/config/cc_growpart.py (+8/-17)
cloudinit/config/cc_grub_dpkg.py (+7/-17)
cloudinit/config/cc_keys_to_console.py (+7/-17)
cloudinit/config/cc_landscape.py (+7/-17)
cloudinit/config/cc_locale.py (+7/-17)
cloudinit/config/cc_lxd.py (+5/-15)
cloudinit/config/cc_mcollective.py (+8/-18)
cloudinit/config/cc_migrator.py (+5/-15)
cloudinit/config/cc_mounts.py (+52/-32)
cloudinit/config/cc_ntp.py (+5/-15)
cloudinit/config/cc_package_update_upgrade_install.py (+5/-15)
cloudinit/config/cc_phone_home.py (+7/-17)
cloudinit/config/cc_power_state_change.py (+5/-15)
cloudinit/config/cc_puppet.py (+7/-17)
cloudinit/config/cc_resizefs.py (+8/-17)
cloudinit/config/cc_resolv_conf.py (+7/-17)
cloudinit/config/cc_rh_subscription.py (+8/-17)
cloudinit/config/cc_rightscale_userdata.py (+7/-17)
cloudinit/config/cc_rsyslog.py (+8/-17)
cloudinit/config/cc_runcmd.py (+7/-17)
cloudinit/config/cc_salt_minion.py (+4/-14)
cloudinit/config/cc_scripts_per_boot.py (+7/-17)
cloudinit/config/cc_scripts_per_instance.py (+7/-17)
cloudinit/config/cc_scripts_per_once.py (+7/-17)
cloudinit/config/cc_scripts_user.py (+7/-17)
cloudinit/config/cc_scripts_vendor.py (+6/-16)
cloudinit/config/cc_seed_random.py (+8/-18)
cloudinit/config/cc_set_hostname.py (+8/-18)
cloudinit/config/cc_set_passwords.py (+52/-19)
cloudinit/config/cc_snap_config.py (+5/-15)
cloudinit/config/cc_snappy.py (+3/-13)
cloudinit/config/cc_spacewalk.py (+3/-13)
cloudinit/config/cc_ssh.py (+7/-17)
cloudinit/config/cc_ssh_authkey_fingerprints.py (+5/-15)
cloudinit/config/cc_ssh_import_id.py (+7/-17)
cloudinit/config/cc_timezone.py (+7/-17)
cloudinit/config/cc_ubuntu_init_switch.py (+5/-15)
cloudinit/config/cc_update_etc_hosts.py (+7/-17)
cloudinit/config/cc_update_hostname.py (+7/-17)
cloudinit/config/cc_users_groups.py (+5/-15)
cloudinit/config/cc_write_files.py (+5/-15)
cloudinit/config/cc_yum_add_repo.py (+5/-15)
cloudinit/cs_utils.py (+6/-15)
cloudinit/dhclient_hook.py (+3/-2)
cloudinit/distros/__init__.py (+35/-28)
cloudinit/distros/arch.py (+5/-15)
cloudinit/distros/debian.py (+25/-32)
cloudinit/distros/fedora.py (+9/-19)
cloudinit/distros/freebsd.py (+5/-15)
cloudinit/distros/gentoo.py (+7/-17)
cloudinit/distros/net_util.py (+9/-19)
cloudinit/distros/parsers/__init__.py (+5/-15)
cloudinit/distros/parsers/hostname.py (+5/-15)
cloudinit/distros/parsers/hosts.py (+5/-15)
cloudinit/distros/parsers/resolv_conf.py (+12/-19)
cloudinit/distros/parsers/sys_conf.py (+5/-15)
cloudinit/distros/rhel.py (+22/-32)
cloudinit/distros/rhel_util.py (+9/-20)
cloudinit/distros/sles.py (+5/-17)
cloudinit/distros/ubuntu.py (+10/-20)
cloudinit/distros/ug_util.py (+10/-20)
cloudinit/ec2_utils.py (+11/-18)
cloudinit/filters/__init__.py (+0/-21)
cloudinit/filters/launch_index.py (+9/-19)
cloudinit/gpg.py (+8/-17)
cloudinit/handlers/__init__.py (+9/-19)
cloudinit/handlers/boot_hook.py (+9/-19)
cloudinit/handlers/cloud_config.py (+9/-19)
cloudinit/handlers/shell_script.py (+9/-19)
cloudinit/handlers/upstart_job.py (+10/-20)
cloudinit/helpers.py (+11/-19)
cloudinit/importer.py (+9/-19)
cloudinit/log.py (+9/-19)
cloudinit/mergers/__init__.py (+5/-15)
cloudinit/mergers/m_dict.py (+5/-15)
cloudinit/mergers/m_list.py (+5/-15)
cloudinit/mergers/m_str.py (+3/-14)
cloudinit/net/__init__.py (+94/-98)
cloudinit/net/cmdline.py (+27/-26)
cloudinit/net/eni.py (+42/-38)
cloudinit/net/netplan.py (+373/-0)
cloudinit/net/network_state.py (+312/-22)
cloudinit/net/renderer.py (+16/-15)
cloudinit/net/renderers.py (+53/-0)
cloudinit/net/sysconfig.py (+69/-35)
cloudinit/net/udev.py (+3/-14)
cloudinit/netinfo.py (+9/-19)
cloudinit/patcher.py (+7/-17)
cloudinit/registry.py (+5/-3)
cloudinit/reporting/__init__.py (+3/-2)
cloudinit/reporting/events.py (+4/-3)
cloudinit/reporting/handlers.py (+3/-1)
cloudinit/safeyaml.py (+6/-15)
cloudinit/serial.py (+3/-14)
cloudinit/settings.py (+12/-19)
cloudinit/signal_handler.py (+7/-17)
cloudinit/sources/DataSourceAliYun.py (+8/-1)
cloudinit/sources/DataSourceAltCloud.py (+10/-20)
cloudinit/sources/DataSourceAzure.py (+158/-144)
cloudinit/sources/DataSourceBigstep.py (+7/-4)
cloudinit/sources/DataSourceCloudSigma.py (+7/-16)
cloudinit/sources/DataSourceCloudStack.py (+13/-23)
cloudinit/sources/DataSourceConfigDrive.py (+15/-22)
cloudinit/sources/DataSourceDigitalOcean.py (+5/-15)
cloudinit/sources/DataSourceEc2.py (+159/-21)
cloudinit/sources/DataSourceGCE.py (+5/-15)
cloudinit/sources/DataSourceMAAS.py (+7/-17)
cloudinit/sources/DataSourceNoCloud.py (+9/-19)
cloudinit/sources/DataSourceNone.py (+5/-15)
cloudinit/sources/DataSourceOVF.py (+42/-23)
cloudinit/sources/DataSourceOpenNebula.py (+15/-25)
cloudinit/sources/DataSourceOpenStack.py (+17/-18)
cloudinit/sources/DataSourceSmartOS.py (+6/-17)
cloudinit/sources/__init__.py (+25/-21)
cloudinit/sources/helpers/__init__.py (+0/-13)
cloudinit/sources/helpers/azure.py (+4/-0)
cloudinit/sources/helpers/digitalocean.py (+4/-14)
cloudinit/sources/helpers/openstack.py (+21/-19)
cloudinit/sources/helpers/vmware/__init__.py (+0/-13)
cloudinit/sources/helpers/vmware/imc/__init__.py (+0/-13)
cloudinit/sources/helpers/vmware/imc/boot_proto.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/config.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/config_file.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/config_namespace.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/config_nic.py (+12/-34)
cloudinit/sources/helpers/vmware/imc/config_source.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/guestcust_error.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/guestcust_event.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/guestcust_state.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/guestcust_util.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/ipv4_mode.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/nic.py (+6/-16)
cloudinit/sources/helpers/vmware/imc/nic_base.py (+6/-16)
cloudinit/ssh_util.py (+26/-24)
cloudinit/stages.py (+40/-38)
cloudinit/templater.py (+11/-21)
cloudinit/type_utils.py (+9/-19)
cloudinit/url_helper.py (+10/-20)
cloudinit/user_data.py (+9/-19)
cloudinit/util.py (+89/-93)
cloudinit/version.py (+13/-16)
cloudinit/warnings.py (+139/-0)
config/cloud.cfg.d/05_logging.cfg (+10/-5)
dev/null (+0/-53)
doc/examples/cloud-config-apt.txt (+2/-2)
doc/examples/cloud-config-boot-cmds.txt (+2/-2)
doc/examples/cloud-config-gluster.txt (+2/-2)
doc/examples/cloud-config-mount-points.txt (+4/-4)
doc/examples/cloud-config.txt (+4/-4)
doc/merging.rst (+42/-35)
doc/rtd/index.rst (+32/-17)
doc/rtd/topics/availability.rst (+4/-3)
doc/rtd/topics/boot.rst (+128/-0)
doc/rtd/topics/capabilities.rst (+31/-6)
doc/rtd/topics/datasources.rst (+38/-140)
doc/rtd/topics/datasources/altcloud.rst (+91/-0)
doc/rtd/topics/datasources/azure.rst (+155/-0)
doc/rtd/topics/datasources/cloudsigma.rst (+40/-0)
doc/rtd/topics/datasources/cloudstack.rst (+34/-0)
doc/rtd/topics/datasources/configdrive.rst (+129/-0)
doc/rtd/topics/datasources/digitalocean.rst (+28/-0)
doc/rtd/topics/datasources/ec2.rst (+61/-0)
doc/rtd/topics/datasources/fallback.rst (+16/-0)
doc/rtd/topics/datasources/maas.rst (+8/-0)
doc/rtd/topics/datasources/nocloud.rst (+75/-0)
doc/rtd/topics/datasources/opennebula.rst (+146/-0)
doc/rtd/topics/datasources/openstack.rst (+62/-0)
doc/rtd/topics/datasources/ovf.rst (+12/-0)
doc/rtd/topics/datasources/smartos.rst (+164/-0)
doc/rtd/topics/dir_layout.rst (+3/-2)
doc/rtd/topics/examples.rst (+22/-21)
doc/rtd/topics/format.rst (+22/-20)
doc/rtd/topics/hacking.rst (+1/-0)
doc/rtd/topics/logging.rst (+20/-19)
doc/rtd/topics/merging.rst (+3/-2)
doc/rtd/topics/modules.rst (+3/-2)
doc/rtd/topics/moreinfo.rst (+4/-3)
doc/rtd/topics/tests.rst (+289/-0)
doc/rtd/topics/vendordata.rst (+71/-0)
packages/debian/copyright (+16/-0)
packages/debian/rules.in (+2/-0)
packages/redhat/cloud-init.spec.in (+4/-3)
packages/suse/cloud-init.spec.in (+1/-1)
setup.py (+12/-21)
systemd/cloud-init-generator (+37/-2)
systemd/cloud-init-local.service (+3/-3)
systemd/cloud-init.service (+2/-4)
sysvinit/redhat/cloud-config (+3/-16)
sysvinit/redhat/cloud-final (+3/-16)
sysvinit/redhat/cloud-init (+3/-16)
sysvinit/redhat/cloud-init-local (+3/-16)
tests/cloud_tests/__init__.py (+31/-0)
tests/cloud_tests/__main__.py (+93/-0)
tests/cloud_tests/args.py (+221/-0)
tests/cloud_tests/collect.py (+161/-0)
tests/cloud_tests/config.py (+113/-0)
tests/cloud_tests/configs/bugs/README.md (+13/-0)
tests/cloud_tests/configs/bugs/lp1511485.yaml (+11/-0)
tests/cloud_tests/configs/bugs/lp1611074.yaml (+8/-0)
tests/cloud_tests/configs/bugs/lp1628337.yaml (+20/-0)
tests/cloud_tests/configs/examples/README.md (+12/-0)
tests/cloud_tests/configs/examples/TODO.md (+15/-0)
tests/cloud_tests/configs/examples/add_apt_repositories.yaml (+21/-0)
tests/cloud_tests/configs/examples/alter_completion_message.yaml (+16/-0)
tests/cloud_tests/configs/examples/configure_instance_trusted_ca_certificates.yaml (+41/-0)
tests/cloud_tests/configs/examples/configure_instances_ssh_keys.yaml (+63/-0)
tests/cloud_tests/configs/examples/including_user_groups.yaml (+53/-0)
tests/cloud_tests/configs/examples/install_arbitrary_packages.yaml (+20/-0)
tests/cloud_tests/configs/examples/install_run_chef_recipes.yaml (+94/-0)
tests/cloud_tests/configs/examples/run_apt_upgrade.yaml (+11/-0)
tests/cloud_tests/configs/examples/run_commands.yaml (+16/-0)
tests/cloud_tests/configs/examples/run_commands_first_boot.yaml (+16/-0)
tests/cloud_tests/configs/examples/setup_run_puppet.yaml (+55/-0)
tests/cloud_tests/configs/examples/writing_out_arbitrary_files.yaml (+45/-0)
tests/cloud_tests/configs/main/README.md (+11/-0)
tests/cloud_tests/configs/main/command_output_simple.yaml (+13/-0)
tests/cloud_tests/configs/modules/README.md (+12/-0)
tests/cloud_tests/configs/modules/TODO.md (+100/-0)
tests/cloud_tests/configs/modules/apt_configure_conf.yaml (+19/-0)
tests/cloud_tests/configs/modules/apt_configure_disable_suites.yaml (+17/-0)
tests/cloud_tests/configs/modules/apt_configure_primary.yaml (+19/-0)
tests/cloud_tests/configs/modules/apt_configure_proxy.yaml (+16/-0)
tests/cloud_tests/configs/modules/apt_configure_security.yaml (+15/-0)
tests/cloud_tests/configs/modules/apt_configure_sources_key.yaml (+47/-0)
tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml (+20/-0)
tests/cloud_tests/configs/modules/apt_configure_sources_list.yaml (+19/-0)
tests/cloud_tests/configs/modules/apt_configure_sources_ppa.yaml (+20/-0)
tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml (+13/-0)
tests/cloud_tests/configs/modules/apt_pipelining_os.yaml (+13/-0)
tests/cloud_tests/configs/modules/bootcmd.yaml (+13/-0)
tests/cloud_tests/configs/modules/byobu.yaml (+18/-0)
tests/cloud_tests/configs/modules/ca_certs.yaml (+52/-0)
tests/cloud_tests/configs/modules/debug_disable.yaml (+9/-0)
tests/cloud_tests/configs/modules/debug_enable.yaml (+9/-0)
tests/cloud_tests/configs/modules/final_message.yaml (+13/-0)
tests/cloud_tests/configs/modules/keys_to_console.yaml (+13/-0)
tests/cloud_tests/configs/modules/landscape.yaml (+26/-0)
tests/cloud_tests/configs/modules/locale.yaml (+19/-0)
tests/cloud_tests/configs/modules/lxd_bridge.yaml (+30/-0)
tests/cloud_tests/configs/modules/lxd_dir.yaml (+17/-0)
tests/cloud_tests/configs/modules/ntp.yaml (+20/-0)
tests/cloud_tests/configs/modules/ntp_pools.yaml (+23/-0)
tests/cloud_tests/configs/modules/ntp_servers.yaml (+20/-0)
tests/cloud_tests/configs/modules/package_update_upgrade_install.yaml (+22/-0)
tests/cloud_tests/configs/modules/runcmd.yaml (+13/-0)
tests/cloud_tests/configs/modules/salt_minion.yaml (+34/-0)
tests/cloud_tests/configs/modules/seed_random_command.yaml (+18/-0)
tests/cloud_tests/configs/modules/seed_random_data.yaml (+15/-0)
tests/cloud_tests/configs/modules/set_hostname.yaml (+18/-0)
tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml (+20/-0)
tests/cloud_tests/configs/modules/set_password.yaml (+17/-0)
tests/cloud_tests/configs/modules/set_password_expire.yaml (+28/-0)
tests/cloud_tests/configs/modules/set_password_list.yaml (+40/-0)
tests/cloud_tests/configs/modules/set_password_list_string.yaml (+40/-0)
tests/cloud_tests/configs/modules/snappy.yaml (+13/-0)
tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_disable.yaml (+13/-0)
tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_enable.yaml (+16/-0)
tests/cloud_tests/configs/modules/ssh_import_id.yaml (+14/-0)
tests/cloud_tests/configs/modules/ssh_keys_generate.yaml (+42/-0)
tests/cloud_tests/configs/modules/ssh_keys_provided.yaml (+102/-0)
tests/cloud_tests/configs/modules/timezone.yaml (+14/-0)
tests/cloud_tests/configs/modules/user_groups.yaml (+50/-0)
tests/cloud_tests/configs/modules/write_files.yaml (+42/-0)
tests/cloud_tests/images/__init__.py (+11/-0)
tests/cloud_tests/images/base.py (+65/-0)
tests/cloud_tests/images/lxd.py (+92/-0)
tests/cloud_tests/instances/__init__.py (+10/-0)
tests/cloud_tests/instances/base.py (+120/-0)
tests/cloud_tests/instances/lxd.py (+121/-0)
tests/cloud_tests/manage.py (+75/-0)
tests/cloud_tests/platforms.yaml (+17/-0)
tests/cloud_tests/platforms/__init__.py (+19/-0)
tests/cloud_tests/platforms/base.py (+53/-0)
tests/cloud_tests/platforms/lxd.py (+97/-0)
tests/cloud_tests/releases.yaml (+79/-0)
tests/cloud_tests/setup_image.py (+195/-0)
tests/cloud_tests/snapshots/__init__.py (+10/-0)
tests/cloud_tests/snapshots/base.py (+44/-0)
tests/cloud_tests/snapshots/lxd.py (+50/-0)
tests/cloud_tests/stage.py (+113/-0)
tests/cloud_tests/testcases.yaml (+27/-0)
tests/cloud_tests/testcases/__init__.py (+47/-0)
tests/cloud_tests/testcases/base.py (+137/-0)
tests/cloud_tests/testcases/bugs/__init__.py (+8/-0)
tests/cloud_tests/testcases/bugs/lp1511485.py (+15/-0)
tests/cloud_tests/testcases/bugs/lp1628337.py (+23/-0)
tests/cloud_tests/testcases/examples/__init__.py (+8/-0)
tests/cloud_tests/testcases/examples/add_apt_repositories.py (+20/-0)
tests/cloud_tests/testcases/examples/alter_completion_message.py (+49/-0)
tests/cloud_tests/testcases/examples/configure_instance_trusted_ca_certificates.py (+27/-0)
tests/cloud_tests/testcases/examples/configure_instances_ssh_keys.py (+31/-0)
tests/cloud_tests/testcases/examples/including_user_groups.py (+43/-0)
tests/cloud_tests/testcases/examples/install_arbitrary_packages.py (+20/-0)
tests/cloud_tests/testcases/examples/run_apt_upgrade.py (+19/-0)
tests/cloud_tests/testcases/examples/run_commands.py (+15/-0)
tests/cloud_tests/testcases/examples/run_commands_first_boot.py (+15/-0)
tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.py (+30/-0)
tests/cloud_tests/testcases/main/__init__.py (+8/-0)
tests/cloud_tests/testcases/main/command_output_simple.py (+21/-0)
tests/cloud_tests/testcases/modules/__init__.py (+8/-0)
tests/cloud_tests/testcases/modules/apt_configure_conf.py (+20/-0)
tests/cloud_tests/testcases/modules/apt_configure_disable_suites.py (+15/-0)
tests/cloud_tests/testcases/modules/apt_configure_primary.py (+20/-0)
tests/cloud_tests/testcases/modules/apt_configure_proxy.py (+22/-0)
tests/cloud_tests/testcases/modules/apt_configure_security.py (+15/-0)
tests/cloud_tests/testcases/modules/apt_configure_sources_key.py (+23/-0)
tests/cloud_tests/testcases/modules/apt_configure_sources_keyserver.py (+23/-0)
tests/cloud_tests/testcases/modules/apt_configure_sources_list.py (+26/-0)
tests/cloud_tests/testcases/modules/apt_configure_sources_ppa.py (+23/-0)
tests/cloud_tests/testcases/modules/apt_pipelining_disable.py (+15/-0)
tests/cloud_tests/testcases/modules/apt_pipelining_os.py (+15/-0)
tests/cloud_tests/testcases/modules/bootcmd.py (+15/-0)
tests/cloud_tests/testcases/modules/byobu.py (+25/-0)
tests/cloud_tests/testcases/modules/ca_certs.py (+20/-0)
tests/cloud_tests/testcases/modules/debug_disable.py (+16/-0)
tests/cloud_tests/testcases/modules/debug_enable.py (+15/-0)
tests/cloud_tests/testcases/modules/final_message.py (+49/-0)
tests/cloud_tests/testcases/modules/keys_to_console.py (+22/-0)
tests/cloud_tests/testcases/modules/locale.py (+27/-0)
tests/cloud_tests/testcases/modules/lxd_bridge.py (+26/-0)
tests/cloud_tests/testcases/modules/lxd_dir.py (+20/-0)
tests/cloud_tests/testcases/modules/ntp.py (+28/-0)
tests/cloud_tests/testcases/modules/ntp_pools.py (+28/-0)
tests/cloud_tests/testcases/modules/ntp_servers.py (+25/-0)
tests/cloud_tests/testcases/modules/package_update_upgrade_install.py (+38/-0)
tests/cloud_tests/testcases/modules/runcmd.py (+15/-0)
tests/cloud_tests/testcases/modules/salt_minion.py (+29/-0)
tests/cloud_tests/testcases/modules/seed_random_data.py (+15/-0)
tests/cloud_tests/testcases/modules/set_hostname.py (+15/-0)
tests/cloud_tests/testcases/modules/set_hostname_fqdn.py (+26/-0)
tests/cloud_tests/testcases/modules/set_password.py (+22/-0)
tests/cloud_tests/testcases/modules/set_password_expire.py (+23/-0)
tests/cloud_tests/testcases/modules/set_password_list.py (+11/-0)
tests/cloud_tests/testcases/modules/set_password_list_string.py (+11/-0)
tests/cloud_tests/testcases/modules/snappy.py (+18/-0)
tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py (+24/-0)
tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_enable.py (+18/-0)
tests/cloud_tests/testcases/modules/ssh_import_id.py (+26/-0)
tests/cloud_tests/testcases/modules/ssh_keys_generate.py (+57/-0)
tests/cloud_tests/testcases/modules/ssh_keys_provided.py (+69/-0)
tests/cloud_tests/testcases/modules/timezone.py (+15/-0)
tests/cloud_tests/testcases/modules/user_groups.py (+43/-0)
tests/cloud_tests/testcases/modules/write_files.py (+30/-0)
tests/cloud_tests/util.py (+163/-0)
tests/cloud_tests/verify.py (+93/-0)
tests/data/merge_sources/expected8.yaml (+1/-1)
tests/data/merge_sources/source8-1.yaml (+1/-1)
tests/unittests/__init__.py (+2/-0)
tests/unittests/helpers.py (+63/-48)
tests/unittests/test__init__.py (+61/-33)
tests/unittests/test_atomic_helper.py (+6/-2)
tests/unittests/test_builtin_handlers.py (+4/-0)
tests/unittests/test_cli.py (+5/-0)
tests/unittests/test_cs_util.py (+4/-0)
tests/unittests/test_data.py (+76/-0)
tests/unittests/test_datasource/test_aliyun.py (+4/-0)
tests/unittests/test_datasource/test_altcloud.py (+6/-18)
tests/unittests/test_datasource/test_azure.py (+32/-22)
tests/unittests/test_datasource/test_azure_helper.py (+4/-0)
tests/unittests/test_datasource/test_cloudsigma.py (+20/-2)
tests/unittests/test_datasource/test_cloudstack.py (+4/-0)
tests/unittests/test_datasource/test_common.py (+75/-0)
tests/unittests/test_datasource/test_configdrive.py (+6/-3)
tests/unittests/test_datasource/test_digitalocean.py (+5/-14)
tests/unittests/test_datasource/test_gce.py (+8/-15)
tests/unittests/test_datasource/test_maas.py (+2/-0)
tests/unittests/test_datasource/test_nocloud.py (+2/-0)
tests/unittests/test_datasource/test_opennebula.py (+2/-0)
tests/unittests/test_datasource/test_openstack.py (+10/-23)
tests/unittests/test_datasource/test_ovf.py (+5/-15)
tests/unittests/test_datasource/test_smartos.py (+12/-21)
tests/unittests/test_distros/test_create_users.py (+151/-0)
tests/unittests/test_distros/test_generic.py (+2/-0)
tests/unittests/test_distros/test_hostname.py (+4/-0)
tests/unittests/test_distros/test_hosts.py (+4/-0)
tests/unittests/test_distros/test_netconfig.py (+354/-4)
tests/unittests/test_distros/test_resolv.py (+5/-1)
tests/unittests/test_distros/test_sysconfig.py (+4/-0)
tests/unittests/test_distros/test_user_data_normalize.py (+4/-0)
tests/unittests/test_ec2_util.py (+51/-2)
tests/unittests/test_filters/test_launch_index.py (+4/-0)
tests/unittests/test_handler/test_handler_apt_conf_v1.py (+2/-0)
tests/unittests/test_handler/test_handler_apt_configure_sources_list_v1.py (+2/-0)
tests/unittests/test_handler/test_handler_apt_configure_sources_list_v3.py (+2/-0)
tests/unittests/test_handler/test_handler_apt_source_v1.py (+2/-0)
tests/unittests/test_handler/test_handler_apt_source_v3.py (+2/-0)
tests/unittests/test_handler/test_handler_ca_certs.py (+4/-0)
tests/unittests/test_handler/test_handler_chef.py (+4/-0)
tests/unittests/test_handler/test_handler_debug.py (+4/-14)
tests/unittests/test_handler/test_handler_disk_setup.py (+120/-0)
tests/unittests/test_handler/test_handler_growpart.py (+2/-0)
tests/unittests/test_handler/test_handler_locale.py (+5/-15)
tests/unittests/test_handler/test_handler_lxd.py (+4/-0)
tests/unittests/test_handler/test_handler_mcollective.py (+4/-0)
tests/unittests/test_handler/test_handler_mounts.py (+4/-0)
tests/unittests/test_handler/test_handler_ntp.py (+4/-0)
tests/unittests/test_handler/test_handler_power_state.py (+4/-0)
tests/unittests/test_handler/test_handler_rsyslog.py (+4/-0)
tests/unittests/test_handler/test_handler_seed_random.py (+5/-11)
tests/unittests/test_handler/test_handler_set_hostname.py (+4/-0)
tests/unittests/test_handler/test_handler_snappy.py (+4/-0)
tests/unittests/test_handler/test_handler_spacewalk.py (+4/-0)
tests/unittests/test_handler/test_handler_timezone.py (+5/-15)
tests/unittests/test_handler/test_handler_write_files.py (+2/-0)
tests/unittests/test_handler/test_handler_yum_add_repo.py (+4/-0)
tests/unittests/test_helpers.py (+4/-0)
tests/unittests/test_merging.py (+4/-0)
tests/unittests/test_net.py (+740/-66)
tests/unittests/test_pathprefix2dict.py (+2/-0)
tests/unittests/test_registry.py (+4/-0)
tests/unittests/test_reporting.py (+3/-2)
tests/unittests/test_rh_subscription.py (+7/-13)
tests/unittests/test_runs/test_merge_run.py (+4/-0)
tests/unittests/test_runs/test_simple_run.py (+4/-0)
tests/unittests/test_sshutil.py (+25/-1)
tests/unittests/test_templating.py (+5/-15)
tests/unittests/test_util.py (+71/-0)
tests/unittests/test_version.py (+14/-0)
tests/unittests/test_vmware_config_file.py (+6/-16)
tools/Z99-cloud-locale-test.sh (+77/-75)
tools/Z99-cloudinit-warnings.sh (+30/-0)
tools/cloud-init-per (+1/-0)
tools/ds-identify (+1266/-0)
tools/hacking.py (+3/-2)
tools/hook-dhclient (+3/-0)
tools/hook-network-manager (+2/-0)
tools/hook-rhel.sh (+2/-0)
tools/make-mime.py (+3/-1)
tools/make-tarball (+1/-1)
tools/mock-meta.py (+27/-12)
tools/motd-hook (+4/-16)
tools/net-convert.py (+84/-0)
tools/read-dependencies (+2/-0)
tools/read-version (+3/-1)
tools/uncloud-init (+2/-1)
tools/validate-yaml.py (+5/-3)
tools/write-ssh-key-fingerprints (+1/-0)
tox.ini (+31/-7)
Conflict in cloudinit/config/cc_set_passwords.py
Reviewer Review Type Date Requested Status
Tore Approve
Review via email: mp+320986@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tore (tore.lonoy) wrote :

utACK

review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 865cac1..3946ec7 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -5,3 +5,4 @@ dist
6 __pycache__
7 .tox
8 .coverage
9+doc/rtd_html
10diff --git a/.pylintrc b/.pylintrc
11new file mode 100644
12index 0000000..b8cda03
13--- /dev/null
14+++ b/.pylintrc
15@@ -0,0 +1,39 @@
16+[MASTER]
17+
18+# --go-faster, use multiple processes to speed up Pylint
19+jobs=4
20+
21+
22+[MESSAGES CONTROL]
23+
24+# Errors only
25+disable=C, F, I, R, W
26+
27+
28+[REPORTS]
29+
30+# Set the output format. Available formats are text, parseable, colorized, msvs
31+output-format=colorized
32+
33+# Just the errors please, no full report
34+reports=no
35+
36+
37+[TYPECHECK]
38+
39+# List of module names for which member attributes should not be checked
40+# (useful for modules/projects where namespaces are manipulated during runtime
41+# and thus existing member attributes cannot be deduced by static analysis. It
42+# supports qualified module names, as well as Unix pattern matching.
43+ignored-modules=six.moves,pkg_resources
44+
45+# List of class names for which member attributes should not be checked (useful
46+# for classes with dynamically set attributes). This supports the use of
47+# qualified names.
48+ignored-classes=optparse.Values,thread._local
49+
50+# List of members which are set dynamically and missed by pylint inference
51+# system, and so shouldn't trigger E1101 when accessed. Python regular
52+# expressions are accepted.
53+generated-members=types,http.client,command_handlers
54+
55diff --git a/ChangeLog b/ChangeLog
56index 71df7ad..80405bc 100644
57--- a/ChangeLog
58+++ b/ChangeLog
59@@ -1,3 +1,100 @@
60+0.7.9:
61+ - doc: adjust headers in tests documentation for consistency.
62+ - pep8: fix issue found in zesty build with pycodestyle.
63+ - integration test: initial commit of integration test framework
64+ [Wesley Wiedenmeier]
65+ - LICENSE: Allow dual licensing GPL-3 or Apache 2.0 [Jon Grimm]
66+ - Fix config order of precedence, putting kernel command line over system.
67+ [Wesley Wiedenmeier] (LP: #1582323)
68+ - pep8: whitespace fix
69+ - Update the list of valid ssh keys. [Michael Felt]
70+ - network: add ENI unit test for statically rendered routes.
71+ - set_hostname: avoid erroneously appending domain to fqdn
72+ [Lars Kellogg-Stedman] (LP: #1647910)
73+ - doc: change 'nobootwait' to 'nofail' in docs [Anhad Jai Singh]
74+ - Replace an expired bit.ly link in code comment.
75+ - user-groups: fix bug when groups was provided as string and had spaces
76+ (LP: #1354694)
77+ - mounts: use mount -a again to accomplish mounts (LP: #1647708)
78+ - CloudSigma: Fix bug where datasource was not loaded in local search.
79+ (LP: #1648380)
80+ - when adding a user, strip whitespace from group list [Lars Kellogg-Stedman]
81+ (LP: #1354694)
82+ - fix decoding of utf-8 chars in yaml test
83+ - Replace usage of sys_netdev_info with read_sys_net (LP: #1625766)
84+ - fix problems found in python2.6 test.
85+ - OpenStack: extend physical types to include hyperv, hw_veb, vhost_user.
86+ (LP: #1642679)
87+ - tests: fix assumptions that expected no eth0 in system. (LP: #1644043)
88+ - net/cmdline: Consider ip= or ip6= on command line not only ip=
89+ (LP: #1639930)
90+ - Just use file logging by default (LP: #1643990)
91+ - Improve formatting for ProcessExecutionError [Wesley Wiedenmeier]
92+ - flake8: fix trailing white space
93+ - Doc: various documentation fixes [Sean Bright]
94+ - cloudinit/config/cc_rh_subscription.py: Remove repos before adding
95+ [Brent Baude]
96+ - packages/redhat: fix rpm spec file.
97+ - main: set TZ in environment if not already set. [Ryan Harper]
98+ - Azure: No longer rely on walinux agent. (LP: #1538522)
99+ - disk_setup: Use sectors as unit when formatting MBR disks with sfdisk.
100+ [Daniel Watkins] (LP: #1460715)
101+ - Add activate_datasource, for datasource specific code paths. (LP: #1611074)
102+ - systemd: cloud-init-local use RequiresMountsFor=/var/lib/cloud
103+ (LP: #1642062)
104+ - systemd: cloud-init remove After=systemd-networkd-wait-online
105+ - systemd: cloud-init-local change Before basic to sysinit
106+ - pep8: fix style errors reported by pycodestyle 2.1.0
107+ - systemd: drop both Wants and After local-fs.target
108+ - systemd: networking service adjustments. (LP: #1636912)
109+ - systemd: replace Before=basic.target, dbus.target with sysinit.target
110+ (LP: #1629797)
111+ - doc: Add documentation on stages of boot.
112+ - doc: make the RST files consistently formated and other improvements.
113+ - Ec2: fix syntax and tox in previous commit.
114+ - Ec2: protect against non-dictionary in block-device-mapping.
115+ - doc: fixed example to not overwrite /etc/hosts [Chris Glass]
116+ - Doc: fix spelling / typos in ca_certs and scripts_vendor.
117+ - pyflakes: fix issue with pyflakes 1.3 found in ubuntu zesty-proposed.
118+ - net/cmdline: Further adjustments to ipv6 support [LaMont Jones]
119+ (LP: #1621615)
120+ - Add coverage dependency to bddeb to fix package build.
121+ - doc: improve HACKING.rst file
122+ - dmidecode: Allow dmidecode to be used on aarch64 [Robert Schweikert]
123+ - AliYun: Add new datasource for Ali-Cloud ECS [kaihuan.pkh]
124+ - Add coverage collection to tox unit tests. [Joshua Powers]
125+ - cc_users_groups: fix remaing call to ds.normalize_user_groups [Ryan Harper]
126+ - disk-config: udev settle after partitioning in gpt format. (LP: #1626243)
127+ - unittests: do not read system /etc/cloud/cloud.cfg.d (LP: #1635350)
128+ - Add documentation for logging features. [Wesley Wiedenmeier]
129+ - Add support for snap create-user on Ubuntu Core images. [Ryan Harper]
130+ - Fix sshd restarts for rhel distros. [Jim Gorz]
131+ - OpenNebula: replace 'ip' parsing with cloudinit.net usage.
132+ - Fix python2.6 things found running in centos 6.
133+ - Move user/group functions to new ug_util file
134+ - DigitalOcean: enable usage of data source by default.
135+ - update Gentoo initscripts to run in the correct order [Matthew Thode]
136+ - MAAS: improve the main of datasource to look at kernel cmdline config.
137+ - tests: silence the Cheetah UserWarning about NameMapper C version.
138+ - systemd: Run cloud-init.service Before dbus.socket not dbus.target
139+ [Daniel Watkins] (LP: #1629797)
140+ - systemd: run cloud-init.service Before dbus.service (LP: #1629797)
141+ - unittests: fix use of mock 2.0 'assert_called' when running make check
142+ [Ryan Harper]
143+ - Improve module documentation and doc cleanup. [Wesley Wiedenmeier]
144+ - lxd: Update network config for LXD 2.3 [Stéphane Graber]
145+ - DigitalOcean: use meta-data for network configruation [Ben Howard]
146+ - ntp: move to run after apt configuration (LP: #1628337)
147+ - Decode unicode types in decode_binary [Robert Schweikert]
148+ - systemd: Ensure that cloud-init-local happens before NetworkManager
149+ - Allow ephemeral drive to be unpartitioned [Paul Meyer]
150+ - subp: add 'update_env' argument
151+ - net: support reading ipv6 dhcp config from initramfs [LaMont Jones]
152+ (LP: #1621615, #1621507)
153+ - Adjust mounts and disk configuration for systemd. (LP: #1611074)
154+ - dmidecode: run dmidecode only on i?86 or x86_64 arch. [Robert Schweikert]
155+ - systemd: put cloud-init.target After multi-user.target (LP: #1623868)
156+
157 0.7.8:
158 - SmartOS: more improvements for network configuration
159 - add ntp config module [Ryan Harper]
160diff --git a/HACKING.rst b/HACKING.rst
161index 4072d0f..caee7ac 100644
162--- a/HACKING.rst
163+++ b/HACKING.rst
164@@ -1,13 +1,13 @@
165-=====================
166+*********************
167 Hacking on cloud-init
168-=====================
169+*********************
170
171 This document describes how to contribute changes to cloud-init.
172 It assumes you have a `Launchpad`_ account, and refers to your launchpad user
173 as ``LP_USER`` throughout.
174
175 Do these things once
176---------------------
177+====================
178
179 * To contribute, you must sign the Canonical `contributor license agreement`_
180
181@@ -21,11 +21,12 @@ Do these things once
182 There is more information on Launchpad as a git hosting site in
183 `Launchpad git documentation`_.
184
185-* Create a new remote pointing to your personal Launchpad repository
186+* Create a new remote pointing to your personal Launchpad repository.
187+ This is equivalent to 'fork' on github.
188
189- This is equivalent to 'fork' on github::
190+ .. code:: sh
191
192- git remote add LP_USER git+ssh://LP_USER@git.launchpad.net/~LP_USER/cloud-init
193+ git remote add LP_USER ssh://LP_USER@git.launchpad.net/~LP_USER/cloud-init
194 git push LP_USER master
195
196 .. _repository: https://git.launchpad.net/cloud-init
197@@ -34,7 +35,7 @@ Do these things once
198 .. _Launchpad git documentation: https://help.launchpad.net/Code/Git
199
200 Do these things for each feature or bug
201----------------------------------------
202+=======================================
203
204 * Create a new topic branch for your work::
205
206diff --git a/LICENSE b/LICENSE
207index 94a9ed0..8a23b4d 100644
208--- a/LICENSE
209+++ b/LICENSE
210@@ -1,674 +1,22 @@
211- GNU GENERAL PUBLIC LICENSE
212- Version 3, 29 June 2007
213-
214- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
215- Everyone is permitted to copy and distribute verbatim copies
216- of this license document, but changing it is not allowed.
217-
218- Preamble
219-
220- The GNU General Public License is a free, copyleft license for
221-software and other kinds of works.
222-
223- The licenses for most software and other practical works are designed
224-to take away your freedom to share and change the works. By contrast,
225-the GNU General Public License is intended to guarantee your freedom to
226-share and change all versions of a program--to make sure it remains free
227-software for all its users. We, the Free Software Foundation, use the
228-GNU General Public License for most of our software; it applies also to
229-any other work released this way by its authors. You can apply it to
230-your programs, too.
231-
232- When we speak of free software, we are referring to freedom, not
233-price. Our General Public Licenses are designed to make sure that you
234-have the freedom to distribute copies of free software (and charge for
235-them if you wish), that you receive source code or can get it if you
236-want it, that you can change the software or use pieces of it in new
237-free programs, and that you know you can do these things.
238-
239- To protect your rights, we need to prevent others from denying you
240-these rights or asking you to surrender the rights. Therefore, you have
241-certain responsibilities if you distribute copies of the software, or if
242-you modify it: responsibilities to respect the freedom of others.
243-
244- For example, if you distribute copies of such a program, whether
245-gratis or for a fee, you must pass on to the recipients the same
246-freedoms that you received. You must make sure that they, too, receive
247-or can get the source code. And you must show them these terms so they
248-know their rights.
249-
250- Developers that use the GNU GPL protect your rights with two steps:
251-(1) assert copyright on the software, and (2) offer you this License
252-giving you legal permission to copy, distribute and/or modify it.
253-
254- For the developers' and authors' protection, the GPL clearly explains
255-that there is no warranty for this free software. For both users' and
256-authors' sake, the GPL requires that modified versions be marked as
257-changed, so that their problems will not be attributed erroneously to
258-authors of previous versions.
259-
260- Some devices are designed to deny users access to install or run
261-modified versions of the software inside them, although the manufacturer
262-can do so. This is fundamentally incompatible with the aim of
263-protecting users' freedom to change the software. The systematic
264-pattern of such abuse occurs in the area of products for individuals to
265-use, which is precisely where it is most unacceptable. Therefore, we
266-have designed this version of the GPL to prohibit the practice for those
267-products. If such problems arise substantially in other domains, we
268-stand ready to extend this provision to those domains in future versions
269-of the GPL, as needed to protect the freedom of users.
270-
271- Finally, every program is threatened constantly by software patents.
272-States should not allow patents to restrict development and use of
273-software on general-purpose computers, but in those that do, we wish to
274-avoid the special danger that patents applied to a free program could
275-make it effectively proprietary. To prevent this, the GPL assures that
276-patents cannot be used to render the program non-free.
277-
278- The precise terms and conditions for copying, distribution and
279-modification follow.
280-
281- TERMS AND CONDITIONS
282-
283- 0. Definitions.
284-
285- "This License" refers to version 3 of the GNU General Public License.
286-
287- "Copyright" also means copyright-like laws that apply to other kinds of
288-works, such as semiconductor masks.
289-
290- "The Program" refers to any copyrightable work licensed under this
291-License. Each licensee is addressed as "you". "Licensees" and
292-"recipients" may be individuals or organizations.
293-
294- To "modify" a work means to copy from or adapt all or part of the work
295-in a fashion requiring copyright permission, other than the making of an
296-exact copy. The resulting work is called a "modified version" of the
297-earlier work or a work "based on" the earlier work.
298-
299- A "covered work" means either the unmodified Program or a work based
300-on the Program.
301-
302- To "propagate" a work means to do anything with it that, without
303-permission, would make you directly or secondarily liable for
304-infringement under applicable copyright law, except executing it on a
305-computer or modifying a private copy. Propagation includes copying,
306-distribution (with or without modification), making available to the
307-public, and in some countries other activities as well.
308-
309- To "convey" a work means any kind of propagation that enables other
310-parties to make or receive copies. Mere interaction with a user through
311-a computer network, with no transfer of a copy, is not conveying.
312-
313- An interactive user interface displays "Appropriate Legal Notices"
314-to the extent that it includes a convenient and prominently visible
315-feature that (1) displays an appropriate copyright notice, and (2)
316-tells the user that there is no warranty for the work (except to the
317-extent that warranties are provided), that licensees may convey the
318-work under this License, and how to view a copy of this License. If
319-the interface presents a list of user commands or options, such as a
320-menu, a prominent item in the list meets this criterion.
321-
322- 1. Source Code.
323-
324- The "source code" for a work means the preferred form of the work
325-for making modifications to it. "Object code" means any non-source
326-form of a work.
327-
328- A "Standard Interface" means an interface that either is an official
329-standard defined by a recognized standards body, or, in the case of
330-interfaces specified for a particular programming language, one that
331-is widely used among developers working in that language.
332-
333- The "System Libraries" of an executable work include anything, other
334-than the work as a whole, that (a) is included in the normal form of
335-packaging a Major Component, but which is not part of that Major
336-Component, and (b) serves only to enable use of the work with that
337-Major Component, or to implement a Standard Interface for which an
338-implementation is available to the public in source code form. A
339-"Major Component", in this context, means a major essential component
340-(kernel, window system, and so on) of the specific operating system
341-(if any) on which the executable work runs, or a compiler used to
342-produce the work, or an object code interpreter used to run it.
343-
344- The "Corresponding Source" for a work in object code form means all
345-the source code needed to generate, install, and (for an executable
346-work) run the object code and to modify the work, including scripts to
347-control those activities. However, it does not include the work's
348-System Libraries, or general-purpose tools or generally available free
349-programs which are used unmodified in performing those activities but
350-which are not part of the work. For example, Corresponding Source
351-includes interface definition files associated with source files for
352-the work, and the source code for shared libraries and dynamically
353-linked subprograms that the work is specifically designed to require,
354-such as by intimate data communication or control flow between those
355-subprograms and other parts of the work.
356-
357- The Corresponding Source need not include anything that users
358-can regenerate automatically from other parts of the Corresponding
359-Source.
360-
361- The Corresponding Source for a work in source code form is that
362-same work.
363-
364- 2. Basic Permissions.
365-
366- All rights granted under this License are granted for the term of
367-copyright on the Program, and are irrevocable provided the stated
368-conditions are met. This License explicitly affirms your unlimited
369-permission to run the unmodified Program. The output from running a
370-covered work is covered by this License only if the output, given its
371-content, constitutes a covered work. This License acknowledges your
372-rights of fair use or other equivalent, as provided by copyright law.
373-
374- You may make, run and propagate covered works that you do not
375-convey, without conditions so long as your license otherwise remains
376-in force. You may convey covered works to others for the sole purpose
377-of having them make modifications exclusively for you, or provide you
378-with facilities for running those works, provided that you comply with
379-the terms of this License in conveying all material for which you do
380-not control copyright. Those thus making or running the covered works
381-for you must do so exclusively on your behalf, under your direction
382-and control, on terms that prohibit them from making any copies of
383-your copyrighted material outside their relationship with you.
384-
385- Conveying under any other circumstances is permitted solely under
386-the conditions stated below. Sublicensing is not allowed; section 10
387-makes it unnecessary.
388-
389- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
390-
391- No covered work shall be deemed part of an effective technological
392-measure under any applicable law fulfilling obligations under article
393-11 of the WIPO copyright treaty adopted on 20 December 1996, or
394-similar laws prohibiting or restricting circumvention of such
395-measures.
396-
397- When you convey a covered work, you waive any legal power to forbid
398-circumvention of technological measures to the extent such circumvention
399-is effected by exercising rights under this License with respect to
400-the covered work, and you disclaim any intention to limit operation or
401-modification of the work as a means of enforcing, against the work's
402-users, your or third parties' legal rights to forbid circumvention of
403-technological measures.
404-
405- 4. Conveying Verbatim Copies.
406-
407- You may convey verbatim copies of the Program's source code as you
408-receive it, in any medium, provided that you conspicuously and
409-appropriately publish on each copy an appropriate copyright notice;
410-keep intact all notices stating that this License and any
411-non-permissive terms added in accord with section 7 apply to the code;
412-keep intact all notices of the absence of any warranty; and give all
413-recipients a copy of this License along with the Program.
414-
415- You may charge any price or no price for each copy that you convey,
416-and you may offer support or warranty protection for a fee.
417-
418- 5. Conveying Modified Source Versions.
419-
420- You may convey a work based on the Program, or the modifications to
421-produce it from the Program, in the form of source code under the
422-terms of section 4, provided that you also meet all of these conditions:
423-
424- a) The work must carry prominent notices stating that you modified
425- it, and giving a relevant date.
426-
427- b) The work must carry prominent notices stating that it is
428- released under this License and any conditions added under section
429- 7. This requirement modifies the requirement in section 4 to
430- "keep intact all notices".
431-
432- c) You must license the entire work, as a whole, under this
433- License to anyone who comes into possession of a copy. This
434- License will therefore apply, along with any applicable section 7
435- additional terms, to the whole of the work, and all its parts,
436- regardless of how they are packaged. This License gives no
437- permission to license the work in any other way, but it does not
438- invalidate such permission if you have separately received it.
439-
440- d) If the work has interactive user interfaces, each must display
441- Appropriate Legal Notices; however, if the Program has interactive
442- interfaces that do not display Appropriate Legal Notices, your
443- work need not make them do so.
444-
445- A compilation of a covered work with other separate and independent
446-works, which are not by their nature extensions of the covered work,
447-and which are not combined with it such as to form a larger program,
448-in or on a volume of a storage or distribution medium, is called an
449-"aggregate" if the compilation and its resulting copyright are not
450-used to limit the access or legal rights of the compilation's users
451-beyond what the individual works permit. Inclusion of a covered work
452-in an aggregate does not cause this License to apply to the other
453-parts of the aggregate.
454-
455- 6. Conveying Non-Source Forms.
456-
457- You may convey a covered work in object code form under the terms
458-of sections 4 and 5, provided that you also convey the
459-machine-readable Corresponding Source under the terms of this License,
460-in one of these ways:
461-
462- a) Convey the object code in, or embodied in, a physical product
463- (including a physical distribution medium), accompanied by the
464- Corresponding Source fixed on a durable physical medium
465- customarily used for software interchange.
466-
467- b) Convey the object code in, or embodied in, a physical product
468- (including a physical distribution medium), accompanied by a
469- written offer, valid for at least three years and valid for as
470- long as you offer spare parts or customer support for that product
471- model, to give anyone who possesses the object code either (1) a
472- copy of the Corresponding Source for all the software in the
473- product that is covered by this License, on a durable physical
474- medium customarily used for software interchange, for a price no
475- more than your reasonable cost of physically performing this
476- conveying of source, or (2) access to copy the
477- Corresponding Source from a network server at no charge.
478-
479- c) Convey individual copies of the object code with a copy of the
480- written offer to provide the Corresponding Source. This
481- alternative is allowed only occasionally and noncommercially, and
482- only if you received the object code with such an offer, in accord
483- with subsection 6b.
484-
485- d) Convey the object code by offering access from a designated
486- place (gratis or for a charge), and offer equivalent access to the
487- Corresponding Source in the same way through the same place at no
488- further charge. You need not require recipients to copy the
489- Corresponding Source along with the object code. If the place to
490- copy the object code is a network server, the Corresponding Source
491- may be on a different server (operated by you or a third party)
492- that supports equivalent copying facilities, provided you maintain
493- clear directions next to the object code saying where to find the
494- Corresponding Source. Regardless of what server hosts the
495- Corresponding Source, you remain obligated to ensure that it is
496- available for as long as needed to satisfy these requirements.
497-
498- e) Convey the object code using peer-to-peer transmission, provided
499- you inform other peers where the object code and Corresponding
500- Source of the work are being offered to the general public at no
501- charge under subsection 6d.
502-
503- A separable portion of the object code, whose source code is excluded
504-from the Corresponding Source as a System Library, need not be
505-included in conveying the object code work.
506-
507- A "User Product" is either (1) a "consumer product", which means any
508-tangible personal property which is normally used for personal, family,
509-or household purposes, or (2) anything designed or sold for incorporation
510-into a dwelling. In determining whether a product is a consumer product,
511-doubtful cases shall be resolved in favor of coverage. For a particular
512-product received by a particular user, "normally used" refers to a
513-typical or common use of that class of product, regardless of the status
514-of the particular user or of the way in which the particular user
515-actually uses, or expects or is expected to use, the product. A product
516-is a consumer product regardless of whether the product has substantial
517-commercial, industrial or non-consumer uses, unless such uses represent
518-the only significant mode of use of the product.
519-
520- "Installation Information" for a User Product means any methods,
521-procedures, authorization keys, or other information required to install
522-and execute modified versions of a covered work in that User Product from
523-a modified version of its Corresponding Source. The information must
524-suffice to ensure that the continued functioning of the modified object
525-code is in no case prevented or interfered with solely because
526-modification has been made.
527-
528- If you convey an object code work under this section in, or with, or
529-specifically for use in, a User Product, and the conveying occurs as
530-part of a transaction in which the right of possession and use of the
531-User Product is transferred to the recipient in perpetuity or for a
532-fixed term (regardless of how the transaction is characterized), the
533-Corresponding Source conveyed under this section must be accompanied
534-by the Installation Information. But this requirement does not apply
535-if neither you nor any third party retains the ability to install
536-modified object code on the User Product (for example, the work has
537-been installed in ROM).
538-
539- The requirement to provide Installation Information does not include a
540-requirement to continue to provide support service, warranty, or updates
541-for a work that has been modified or installed by the recipient, or for
542-the User Product in which it has been modified or installed. Access to a
543-network may be denied when the modification itself materially and
544-adversely affects the operation of the network or violates the rules and
545-protocols for communication across the network.
546-
547- Corresponding Source conveyed, and Installation Information provided,
548-in accord with this section must be in a format that is publicly
549-documented (and with an implementation available to the public in
550-source code form), and must require no special password or key for
551-unpacking, reading or copying.
552-
553- 7. Additional Terms.
554-
555- "Additional permissions" are terms that supplement the terms of this
556-License by making exceptions from one or more of its conditions.
557-Additional permissions that are applicable to the entire Program shall
558-be treated as though they were included in this License, to the extent
559-that they are valid under applicable law. If additional permissions
560-apply only to part of the Program, that part may be used separately
561-under those permissions, but the entire Program remains governed by
562-this License without regard to the additional permissions.
563-
564- When you convey a copy of a covered work, you may at your option
565-remove any additional permissions from that copy, or from any part of
566-it. (Additional permissions may be written to require their own
567-removal in certain cases when you modify the work.) You may place
568-additional permissions on material, added by you to a covered work,
569-for which you have or can give appropriate copyright permission.
570-
571- Notwithstanding any other provision of this License, for material you
572-add to a covered work, you may (if authorized by the copyright holders of
573-that material) supplement the terms of this License with terms:
574-
575- a) Disclaiming warranty or limiting liability differently from the
576- terms of sections 15 and 16 of this License; or
577-
578- b) Requiring preservation of specified reasonable legal notices or
579- author attributions in that material or in the Appropriate Legal
580- Notices displayed by works containing it; or
581-
582- c) Prohibiting misrepresentation of the origin of that material, or
583- requiring that modified versions of such material be marked in
584- reasonable ways as different from the original version; or
585-
586- d) Limiting the use for publicity purposes of names of licensors or
587- authors of the material; or
588-
589- e) Declining to grant rights under trademark law for use of some
590- trade names, trademarks, or service marks; or
591-
592- f) Requiring indemnification of licensors and authors of that
593- material by anyone who conveys the material (or modified versions of
594- it) with contractual assumptions of liability to the recipient, for
595- any liability that these contractual assumptions directly impose on
596- those licensors and authors.
597-
598- All other non-permissive additional terms are considered "further
599-restrictions" within the meaning of section 10. If the Program as you
600-received it, or any part of it, contains a notice stating that it is
601-governed by this License along with a term that is a further
602-restriction, you may remove that term. If a license document contains
603-a further restriction but permits relicensing or conveying under this
604-License, you may add to a covered work material governed by the terms
605-of that license document, provided that the further restriction does
606-not survive such relicensing or conveying.
607-
608- If you add terms to a covered work in accord with this section, you
609-must place, in the relevant source files, a statement of the
610-additional terms that apply to those files, or a notice indicating
611-where to find the applicable terms.
612-
613- Additional terms, permissive or non-permissive, may be stated in the
614-form of a separately written license, or stated as exceptions;
615-the above requirements apply either way.
616-
617- 8. Termination.
618-
619- You may not propagate or modify a covered work except as expressly
620-provided under this License. Any attempt otherwise to propagate or
621-modify it is void, and will automatically terminate your rights under
622-this License (including any patent licenses granted under the third
623-paragraph of section 11).
624-
625- However, if you cease all violation of this License, then your
626-license from a particular copyright holder is reinstated (a)
627-provisionally, unless and until the copyright holder explicitly and
628-finally terminates your license, and (b) permanently, if the copyright
629-holder fails to notify you of the violation by some reasonable means
630-prior to 60 days after the cessation.
631-
632- Moreover, your license from a particular copyright holder is
633-reinstated permanently if the copyright holder notifies you of the
634-violation by some reasonable means, this is the first time you have
635-received notice of violation of this License (for any work) from that
636-copyright holder, and you cure the violation prior to 30 days after
637-your receipt of the notice.
638-
639- Termination of your rights under this section does not terminate the
640-licenses of parties who have received copies or rights from you under
641-this License. If your rights have been terminated and not permanently
642-reinstated, you do not qualify to receive new licenses for the same
643-material under section 10.
644-
645- 9. Acceptance Not Required for Having Copies.
646-
647- You are not required to accept this License in order to receive or
648-run a copy of the Program. Ancillary propagation of a covered work
649-occurring solely as a consequence of using peer-to-peer transmission
650-to receive a copy likewise does not require acceptance. However,
651-nothing other than this License grants you permission to propagate or
652-modify any covered work. These actions infringe copyright if you do
653-not accept this License. Therefore, by modifying or propagating a
654-covered work, you indicate your acceptance of this License to do so.
655-
656- 10. Automatic Licensing of Downstream Recipients.
657-
658- Each time you convey a covered work, the recipient automatically
659-receives a license from the original licensors, to run, modify and
660-propagate that work, subject to this License. You are not responsible
661-for enforcing compliance by third parties with this License.
662-
663- An "entity transaction" is a transaction transferring control of an
664-organization, or substantially all assets of one, or subdividing an
665-organization, or merging organizations. If propagation of a covered
666-work results from an entity transaction, each party to that
667-transaction who receives a copy of the work also receives whatever
668-licenses to the work the party's predecessor in interest had or could
669-give under the previous paragraph, plus a right to possession of the
670-Corresponding Source of the work from the predecessor in interest, if
671-the predecessor has it or can get it with reasonable efforts.
672-
673- You may not impose any further restrictions on the exercise of the
674-rights granted or affirmed under this License. For example, you may
675-not impose a license fee, royalty, or other charge for exercise of
676-rights granted under this License, and you may not initiate litigation
677-(including a cross-claim or counterclaim in a lawsuit) alleging that
678-any patent claim is infringed by making, using, selling, offering for
679-sale, or importing the Program or any portion of it.
680-
681- 11. Patents.
682-
683- A "contributor" is a copyright holder who authorizes use under this
684-License of the Program or a work on which the Program is based. The
685-work thus licensed is called the contributor's "contributor version".
686-
687- A contributor's "essential patent claims" are all patent claims
688-owned or controlled by the contributor, whether already acquired or
689-hereafter acquired, that would be infringed by some manner, permitted
690-by this License, of making, using, or selling its contributor version,
691-but do not include claims that would be infringed only as a
692-consequence of further modification of the contributor version. For
693-purposes of this definition, "control" includes the right to grant
694-patent sublicenses in a manner consistent with the requirements of
695-this License.
696-
697- Each contributor grants you a non-exclusive, worldwide, royalty-free
698-patent license under the contributor's essential patent claims, to
699-make, use, sell, offer for sale, import and otherwise run, modify and
700-propagate the contents of its contributor version.
701-
702- In the following three paragraphs, a "patent license" is any express
703-agreement or commitment, however denominated, not to enforce a patent
704-(such as an express permission to practice a patent or covenant not to
705-sue for patent infringement). To "grant" such a patent license to a
706-party means to make such an agreement or commitment not to enforce a
707-patent against the party.
708-
709- If you convey a covered work, knowingly relying on a patent license,
710-and the Corresponding Source of the work is not available for anyone
711-to copy, free of charge and under the terms of this License, through a
712-publicly available network server or other readily accessible means,
713-then you must either (1) cause the Corresponding Source to be so
714-available, or (2) arrange to deprive yourself of the benefit of the
715-patent license for this particular work, or (3) arrange, in a manner
716-consistent with the requirements of this License, to extend the patent
717-license to downstream recipients. "Knowingly relying" means you have
718-actual knowledge that, but for the patent license, your conveying the
719-covered work in a country, or your recipient's use of the covered work
720-in a country, would infringe one or more identifiable patents in that
721-country that you have reason to believe are valid.
722-
723- If, pursuant to or in connection with a single transaction or
724-arrangement, you convey, or propagate by procuring conveyance of, a
725-covered work, and grant a patent license to some of the parties
726-receiving the covered work authorizing them to use, propagate, modify
727-or convey a specific copy of the covered work, then the patent license
728-you grant is automatically extended to all recipients of the covered
729-work and works based on it.
730-
731- A patent license is "discriminatory" if it does not include within
732-the scope of its coverage, prohibits the exercise of, or is
733-conditioned on the non-exercise of one or more of the rights that are
734-specifically granted under this License. You may not convey a covered
735-work if you are a party to an arrangement with a third party that is
736-in the business of distributing software, under which you make payment
737-to the third party based on the extent of your activity of conveying
738-the work, and under which the third party grants, to any of the
739-parties who would receive the covered work from you, a discriminatory
740-patent license (a) in connection with copies of the covered work
741-conveyed by you (or copies made from those copies), or (b) primarily
742-for and in connection with specific products or compilations that
743-contain the covered work, unless you entered into that arrangement,
744-or that patent license was granted, prior to 28 March 2007.
745-
746- Nothing in this License shall be construed as excluding or limiting
747-any implied license or other defenses to infringement that may
748-otherwise be available to you under applicable patent law.
749-
750- 12. No Surrender of Others' Freedom.
751-
752- If conditions are imposed on you (whether by court order, agreement or
753-otherwise) that contradict the conditions of this License, they do not
754-excuse you from the conditions of this License. If you cannot convey a
755-covered work so as to satisfy simultaneously your obligations under this
756-License and any other pertinent obligations, then as a consequence you may
757-not convey it at all. For example, if you agree to terms that obligate you
758-to collect a royalty for further conveying from those to whom you convey
759-the Program, the only way you could satisfy both those terms and this
760-License would be to refrain entirely from conveying the Program.
761-
762- 13. Use with the GNU Affero General Public License.
763-
764- Notwithstanding any other provision of this License, you have
765-permission to link or combine any covered work with a work licensed
766-under version 3 of the GNU Affero General Public License into a single
767-combined work, and to convey the resulting work. The terms of this
768-License will continue to apply to the part which is the covered work,
769-but the special requirements of the GNU Affero General Public License,
770-section 13, concerning interaction through a network will apply to the
771-combination as such.
772-
773- 14. Revised Versions of this License.
774-
775- The Free Software Foundation may publish revised and/or new versions of
776-the GNU General Public License from time to time. Such new versions will
777-be similar in spirit to the present version, but may differ in detail to
778-address new problems or concerns.
779-
780- Each version is given a distinguishing version number. If the
781-Program specifies that a certain numbered version of the GNU General
782-Public License "or any later version" applies to it, you have the
783-option of following the terms and conditions either of that numbered
784-version or of any later version published by the Free Software
785-Foundation. If the Program does not specify a version number of the
786-GNU General Public License, you may choose any version ever published
787-by the Free Software Foundation.
788-
789- If the Program specifies that a proxy can decide which future
790-versions of the GNU General Public License can be used, that proxy's
791-public statement of acceptance of a version permanently authorizes you
792-to choose that version for the Program.
793-
794- Later license versions may give you additional or different
795-permissions. However, no additional obligations are imposed on any
796-author or copyright holder as a result of your choosing to follow a
797-later version.
798-
799- 15. Disclaimer of Warranty.
800-
801- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
802-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
803-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
804-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
805-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
806-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
807-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
808-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
809-
810- 16. Limitation of Liability.
811-
812- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
813-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
814-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
815-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
816-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
817-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
818-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
819-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
820-SUCH DAMAGES.
821-
822- 17. Interpretation of Sections 15 and 16.
823-
824- If the disclaimer of warranty and limitation of liability provided
825-above cannot be given local legal effect according to their terms,
826-reviewing courts shall apply local law that most closely approximates
827-an absolute waiver of all civil liability in connection with the
828-Program, unless a warranty or assumption of liability accompanies a
829-copy of the Program in return for a fee.
830-
831- END OF TERMS AND CONDITIONS
832-
833- How to Apply These Terms to Your New Programs
834-
835- If you develop a new program, and you want it to be of the greatest
836-possible use to the public, the best way to achieve this is to make it
837-free software which everyone can redistribute and change under these terms.
838-
839- To do so, attach the following notices to the program. It is safest
840-to attach them to the start of each source file to most effectively
841-state the exclusion of warranty; and each file should have at least
842-the "copyright" line and a pointer to where the full notice is found.
843-
844- <one line to give the program's name and a brief idea of what it does.>
845- Copyright (C) <year> <name of author>
846-
847- This program is free software: you can redistribute it and/or modify
848- it under the terms of the GNU General Public License as published by
849- the Free Software Foundation, either version 3 of the License, or
850- (at your option) any later version.
851-
852- This program is distributed in the hope that it will be useful,
853- but WITHOUT ANY WARRANTY; without even the implied warranty of
854- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
855- GNU General Public License for more details.
856-
857- You should have received a copy of the GNU General Public License
858- along with this program. If not, see <http://www.gnu.org/licenses/>.
859-
860-Also add information on how to contact you by electronic and paper mail.
861-
862- If the program does terminal interaction, make it output a short
863-notice like this when it starts in an interactive mode:
864-
865- <program> Copyright (C) <year> <name of author>
866- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
867- This is free software, and you are welcome to redistribute it
868- under certain conditions; type `show c' for details.
869-
870-The hypothetical commands `show w' and `show c' should show the appropriate
871-parts of the General Public License. Of course, your program's commands
872-might be different; for a GUI interface, you would use an "about box".
873-
874- You should also get your employer (if you work as a programmer) or school,
875-if any, to sign a "copyright disclaimer" for the program, if necessary.
876-For more information on this, and how to apply and follow the GNU GPL, see
877-<http://www.gnu.org/licenses/>.
878-
879- The GNU General Public License does not permit incorporating your program
880-into proprietary programs. If your program is a subroutine library, you
881-may consider it more useful to permit linking proprietary applications with
882-the library. If this is what you want to do, use the GNU Lesser General
883-Public License instead of this License. But first, please read
884-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
885+Copyright 2015 Canonical Ltd.
886+
887+This program is free software: you can redistribute it and/or modify it under
888+the terms of the GNU General Public License version 3, as published by the
889+Free Software Foundation.
890+
891+This program is distributed in the hope that it will be useful, but WITHOUT
892+ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
893+SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
894+General Public License for more details.
895+
896+You should have received a copy of the GNU General Public License along with
897+this program. If not, see <http://www.gnu.org/licenses/>
898+
899+Alternatively, this program may be used under the terms of the Apache License,
900+Version 2.0, in which case the provisions of that license are applicable
901+instead of those above. If you wish to allow use of your version of this
902+program under the terms of the Apache License, Version 2.0 only, indicate
903+your decision by deleting the provisions above and replace them with the notice
904+and other provisions required by the Apache License, Version 2.0. If you do not
905+delete the provisions above, a recipient may use your version of this file
906+under the terms of either the GPLv3 or the Apache License, Version 2.0.
907diff --git a/LICENSE-Apache2.0 b/LICENSE-Apache2.0
908new file mode 100644
909index 0000000..d645695
910--- /dev/null
911+++ b/LICENSE-Apache2.0
912@@ -0,0 +1,202 @@
913+
914+ Apache License
915+ Version 2.0, January 2004
916+ http://www.apache.org/licenses/
917+
918+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
919+
920+ 1. Definitions.
921+
922+ "License" shall mean the terms and conditions for use, reproduction,
923+ and distribution as defined by Sections 1 through 9 of this document.
924+
925+ "Licensor" shall mean the copyright owner or entity authorized by
926+ the copyright owner that is granting the License.
927+
928+ "Legal Entity" shall mean the union of the acting entity and all
929+ other entities that control, are controlled by, or are under common
930+ control with that entity. For the purposes of this definition,
931+ "control" means (i) the power, direct or indirect, to cause the
932+ direction or management of such entity, whether by contract or
933+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
934+ outstanding shares, or (iii) beneficial ownership of such entity.
935+
936+ "You" (or "Your") shall mean an individual or Legal Entity
937+ exercising permissions granted by this License.
938+
939+ "Source" form shall mean the preferred form for making modifications,
940+ including but not limited to software source code, documentation
941+ source, and configuration files.
942+
943+ "Object" form shall mean any form resulting from mechanical
944+ transformation or translation of a Source form, including but
945+ not limited to compiled object code, generated documentation,
946+ and conversions to other media types.
947+
948+ "Work" shall mean the work of authorship, whether in Source or
949+ Object form, made available under the License, as indicated by a
950+ copyright notice that is included in or attached to the work
951+ (an example is provided in the Appendix below).
952+
953+ "Derivative Works" shall mean any work, whether in Source or Object
954+ form, that is based on (or derived from) the Work and for which the
955+ editorial revisions, annotations, elaborations, or other modifications
956+ represent, as a whole, an original work of authorship. For the purposes
957+ of this License, Derivative Works shall not include works that remain
958+ separable from, or merely link (or bind by name) to the interfaces of,
959+ the Work and Derivative Works thereof.
960+
961+ "Contribution" shall mean any work of authorship, including
962+ the original version of the Work and any modifications or additions
963+ to that Work or Derivative Works thereof, that is intentionally
964+ submitted to Licensor for inclusion in the Work by the copyright owner
965+ or by an individual or Legal Entity authorized to submit on behalf of
966+ the copyright owner. For the purposes of this definition, "submitted"
967+ means any form of electronic, verbal, or written communication sent
968+ to the Licensor or its representatives, including but not limited to
969+ communication on electronic mailing lists, source code control systems,
970+ and issue tracking systems that are managed by, or on behalf of, the
971+ Licensor for the purpose of discussing and improving the Work, but
972+ excluding communication that is conspicuously marked or otherwise
973+ designated in writing by the copyright owner as "Not a Contribution."
974+
975+ "Contributor" shall mean Licensor and any individual or Legal Entity
976+ on behalf of whom a Contribution has been received by Licensor and
977+ subsequently incorporated within the Work.
978+
979+ 2. Grant of Copyright License. Subject to the terms and conditions of
980+ this License, each Contributor hereby grants to You a perpetual,
981+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
982+ copyright license to reproduce, prepare Derivative Works of,
983+ publicly display, publicly perform, sublicense, and distribute the
984+ Work and such Derivative Works in Source or Object form.
985+
986+ 3. Grant of Patent License. Subject to the terms and conditions of
987+ this License, each Contributor hereby grants to You a perpetual,
988+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
989+ (except as stated in this section) patent license to make, have made,
990+ use, offer to sell, sell, import, and otherwise transfer the Work,
991+ where such license applies only to those patent claims licensable
992+ by such Contributor that are necessarily infringed by their
993+ Contribution(s) alone or by combination of their Contribution(s)
994+ with the Work to which such Contribution(s) was submitted. If You
995+ institute patent litigation against any entity (including a
996+ cross-claim or counterclaim in a lawsuit) alleging that the Work
997+ or a Contribution incorporated within the Work constitutes direct
998+ or contributory patent infringement, then any patent licenses
999+ granted to You under this License for that Work shall terminate
1000+ as of the date such litigation is filed.
1001+
1002+ 4. Redistribution. You may reproduce and distribute copies of the
1003+ Work or Derivative Works thereof in any medium, with or without
1004+ modifications, and in Source or Object form, provided that You
1005+ meet the following conditions:
1006+
1007+ (a) You must give any other recipients of the Work or
1008+ Derivative Works a copy of this License; and
1009+
1010+ (b) You must cause any modified files to carry prominent notices
1011+ stating that You changed the files; and
1012+
1013+ (c) You must retain, in the Source form of any Derivative Works
1014+ that You distribute, all copyright, patent, trademark, and
1015+ attribution notices from the Source form of the Work,
1016+ excluding those notices that do not pertain to any part of
1017+ the Derivative Works; and
1018+
1019+ (d) If the Work includes a "NOTICE" text file as part of its
1020+ distribution, then any Derivative Works that You distribute must
1021+ include a readable copy of the attribution notices contained
1022+ within such NOTICE file, excluding those notices that do not
1023+ pertain to any part of the Derivative Works, in at least one
1024+ of the following places: within a NOTICE text file distributed
1025+ as part of the Derivative Works; within the Source form or
1026+ documentation, if provided along with the Derivative Works; or,
1027+ within a display generated by the Derivative Works, if and
1028+ wherever such third-party notices normally appear. The contents
1029+ of the NOTICE file are for informational purposes only and
1030+ do not modify the License. You may add Your own attribution
1031+ notices within Derivative Works that You distribute, alongside
1032+ or as an addendum to the NOTICE text from the Work, provided
1033+ that such additional attribution notices cannot be construed
1034+ as modifying the License.
1035+
1036+ You may add Your own copyright statement to Your modifications and
1037+ may provide additional or different license terms and conditions
1038+ for use, reproduction, or distribution of Your modifications, or
1039+ for any such Derivative Works as a whole, provided Your use,
1040+ reproduction, and distribution of the Work otherwise complies with
1041+ the conditions stated in this License.
1042+
1043+ 5. Submission of Contributions. Unless You explicitly state otherwise,
1044+ any Contribution intentionally submitted for inclusion in the Work
1045+ by You to the Licensor shall be under the terms and conditions of
1046+ this License, without any additional terms or conditions.
1047+ Notwithstanding the above, nothing herein shall supersede or modify
1048+ the terms of any separate license agreement you may have executed
1049+ with Licensor regarding such Contributions.
1050+
1051+ 6. Trademarks. This License does not grant permission to use the trade
1052+ names, trademarks, service marks, or product names of the Licensor,
1053+ except as required for reasonable and customary use in describing the
1054+ origin of the Work and reproducing the content of the NOTICE file.
1055+
1056+ 7. Disclaimer of Warranty. Unless required by applicable law or
1057+ agreed to in writing, Licensor provides the Work (and each
1058+ Contributor provides its Contributions) on an "AS IS" BASIS,
1059+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1060+ implied, including, without limitation, any warranties or conditions
1061+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
1062+ PARTICULAR PURPOSE. You are solely responsible for determining the
1063+ appropriateness of using or redistributing the Work and assume any
1064+ risks associated with Your exercise of permissions under this License.
1065+
1066+ 8. Limitation of Liability. In no event and under no legal theory,
1067+ whether in tort (including negligence), contract, or otherwise,
1068+ unless required by applicable law (such as deliberate and grossly
1069+ negligent acts) or agreed to in writing, shall any Contributor be
1070+ liable to You for damages, including any direct, indirect, special,
1071+ incidental, or consequential damages of any character arising as a
1072+ result of this License or out of the use or inability to use the
1073+ Work (including but not limited to damages for loss of goodwill,
1074+ work stoppage, computer failure or malfunction, or any and all
1075+ other commercial damages or losses), even if such Contributor
1076+ has been advised of the possibility of such damages.
1077+
1078+ 9. Accepting Warranty or Additional Liability. While redistributing
1079+ the Work or Derivative Works thereof, You may choose to offer,
1080+ and charge a fee for, acceptance of support, warranty, indemnity,
1081+ or other liability obligations and/or rights consistent with this
1082+ License. However, in accepting such obligations, You may act only
1083+ on Your own behalf and on Your sole responsibility, not on behalf
1084+ of any other Contributor, and only if You agree to indemnify,
1085+ defend, and hold each Contributor harmless for any liability
1086+ incurred by, or claims asserted against, such Contributor by reason
1087+ of your accepting any such warranty or additional liability.
1088+
1089+ END OF TERMS AND CONDITIONS
1090+
1091+ APPENDIX: How to apply the Apache License to your work.
1092+
1093+ To apply the Apache License to your work, attach the following
1094+ boilerplate notice, with the fields enclosed by brackets "[]"
1095+ replaced with your own identifying information. (Don't include
1096+ the brackets!) The text should be enclosed in the appropriate
1097+ comment syntax for the file format. We also recommend that a
1098+ file or class name and description of purpose be included on the
1099+ same "printed page" as the copyright notice for easier
1100+ identification within third-party archives.
1101+
1102+ Copyright [yyyy] [name of copyright owner]
1103+
1104+ Licensed under the Apache License, Version 2.0 (the "License");
1105+ you may not use this file except in compliance with the License.
1106+ You may obtain a copy of the License at
1107+
1108+ http://www.apache.org/licenses/LICENSE-2.0
1109+
1110+ Unless required by applicable law or agreed to in writing, software
1111+ distributed under the License is distributed on an "AS IS" BASIS,
1112+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1113+ See the License for the specific language governing permissions and
1114+ limitations under the License.
1115diff --git a/LICENSE-GPLv3 b/LICENSE-GPLv3
1116new file mode 100644
1117index 0000000..94a9ed0
1118--- /dev/null
1119+++ b/LICENSE-GPLv3
1120@@ -0,0 +1,674 @@
1121+ GNU GENERAL PUBLIC LICENSE
1122+ Version 3, 29 June 2007
1123+
1124+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
1125+ Everyone is permitted to copy and distribute verbatim copies
1126+ of this license document, but changing it is not allowed.
1127+
1128+ Preamble
1129+
1130+ The GNU General Public License is a free, copyleft license for
1131+software and other kinds of works.
1132+
1133+ The licenses for most software and other practical works are designed
1134+to take away your freedom to share and change the works. By contrast,
1135+the GNU General Public License is intended to guarantee your freedom to
1136+share and change all versions of a program--to make sure it remains free
1137+software for all its users. We, the Free Software Foundation, use the
1138+GNU General Public License for most of our software; it applies also to
1139+any other work released this way by its authors. You can apply it to
1140+your programs, too.
1141+
1142+ When we speak of free software, we are referring to freedom, not
1143+price. Our General Public Licenses are designed to make sure that you
1144+have the freedom to distribute copies of free software (and charge for
1145+them if you wish), that you receive source code or can get it if you
1146+want it, that you can change the software or use pieces of it in new
1147+free programs, and that you know you can do these things.
1148+
1149+ To protect your rights, we need to prevent others from denying you
1150+these rights or asking you to surrender the rights. Therefore, you have
1151+certain responsibilities if you distribute copies of the software, or if
1152+you modify it: responsibilities to respect the freedom of others.
1153+
1154+ For example, if you distribute copies of such a program, whether
1155+gratis or for a fee, you must pass on to the recipients the same
1156+freedoms that you received. You must make sure that they, too, receive
1157+or can get the source code. And you must show them these terms so they
1158+know their rights.
1159+
1160+ Developers that use the GNU GPL protect your rights with two steps:
1161+(1) assert copyright on the software, and (2) offer you this License
1162+giving you legal permission to copy, distribute and/or modify it.
1163+
1164+ For the developers' and authors' protection, the GPL clearly explains
1165+that there is no warranty for this free software. For both users' and
1166+authors' sake, the GPL requires that modified versions be marked as
1167+changed, so that their problems will not be attributed erroneously to
1168+authors of previous versions.
1169+
1170+ Some devices are designed to deny users access to install or run
1171+modified versions of the software inside them, although the manufacturer
1172+can do so. This is fundamentally incompatible with the aim of
1173+protecting users' freedom to change the software. The systematic
1174+pattern of such abuse occurs in the area of products for individuals to
1175+use, which is precisely where it is most unacceptable. Therefore, we
1176+have designed this version of the GPL to prohibit the practice for those
1177+products. If such problems arise substantially in other domains, we
1178+stand ready to extend this provision to those domains in future versions
1179+of the GPL, as needed to protect the freedom of users.
1180+
1181+ Finally, every program is threatened constantly by software patents.
1182+States should not allow patents to restrict development and use of
1183+software on general-purpose computers, but in those that do, we wish to
1184+avoid the special danger that patents applied to a free program could
1185+make it effectively proprietary. To prevent this, the GPL assures that
1186+patents cannot be used to render the program non-free.
1187+
1188+ The precise terms and conditions for copying, distribution and
1189+modification follow.
1190+
1191+ TERMS AND CONDITIONS
1192+
1193+ 0. Definitions.
1194+
1195+ "This License" refers to version 3 of the GNU General Public License.
1196+
1197+ "Copyright" also means copyright-like laws that apply to other kinds of
1198+works, such as semiconductor masks.
1199+
1200+ "The Program" refers to any copyrightable work licensed under this
1201+License. Each licensee is addressed as "you". "Licensees" and
1202+"recipients" may be individuals or organizations.
1203+
1204+ To "modify" a work means to copy from or adapt all or part of the work
1205+in a fashion requiring copyright permission, other than the making of an
1206+exact copy. The resulting work is called a "modified version" of the
1207+earlier work or a work "based on" the earlier work.
1208+
1209+ A "covered work" means either the unmodified Program or a work based
1210+on the Program.
1211+
1212+ To "propagate" a work means to do anything with it that, without
1213+permission, would make you directly or secondarily liable for
1214+infringement under applicable copyright law, except executing it on a
1215+computer or modifying a private copy. Propagation includes copying,
1216+distribution (with or without modification), making available to the
1217+public, and in some countries other activities as well.
1218+
1219+ To "convey" a work means any kind of propagation that enables other
1220+parties to make or receive copies. Mere interaction with a user through
1221+a computer network, with no transfer of a copy, is not conveying.
1222+
1223+ An interactive user interface displays "Appropriate Legal Notices"
1224+to the extent that it includes a convenient and prominently visible
1225+feature that (1) displays an appropriate copyright notice, and (2)
1226+tells the user that there is no warranty for the work (except to the
1227+extent that warranties are provided), that licensees may convey the
1228+work under this License, and how to view a copy of this License. If
1229+the interface presents a list of user commands or options, such as a
1230+menu, a prominent item in the list meets this criterion.
1231+
1232+ 1. Source Code.
1233+
1234+ The "source code" for a work means the preferred form of the work
1235+for making modifications to it. "Object code" means any non-source
1236+form of a work.
1237+
1238+ A "Standard Interface" means an interface that either is an official
1239+standard defined by a recognized standards body, or, in the case of
1240+interfaces specified for a particular programming language, one that
1241+is widely used among developers working in that language.
1242+
1243+ The "System Libraries" of an executable work include anything, other
1244+than the work as a whole, that (a) is included in the normal form of
1245+packaging a Major Component, but which is not part of that Major
1246+Component, and (b) serves only to enable use of the work with that
1247+Major Component, or to implement a Standard Interface for which an
1248+implementation is available to the public in source code form. A
1249+"Major Component", in this context, means a major essential component
1250+(kernel, window system, and so on) of the specific operating system
1251+(if any) on which the executable work runs, or a compiler used to
1252+produce the work, or an object code interpreter used to run it.
1253+
1254+ The "Corresponding Source" for a work in object code form means all
1255+the source code needed to generate, install, and (for an executable
1256+work) run the object code and to modify the work, including scripts to
1257+control those activities. However, it does not include the work's
1258+System Libraries, or general-purpose tools or generally available free
1259+programs which are used unmodified in performing those activities but
1260+which are not part of the work. For example, Corresponding Source
1261+includes interface definition files associated with source files for
1262+the work, and the source code for shared libraries and dynamically
1263+linked subprograms that the work is specifically designed to require,
1264+such as by intimate data communication or control flow between those
1265+subprograms and other parts of the work.
1266+
1267+ The Corresponding Source need not include anything that users
1268+can regenerate automatically from other parts of the Corresponding
1269+Source.
1270+
1271+ The Corresponding Source for a work in source code form is that
1272+same work.
1273+
1274+ 2. Basic Permissions.
1275+
1276+ All rights granted under this License are granted for the term of
1277+copyright on the Program, and are irrevocable provided the stated
1278+conditions are met. This License explicitly affirms your unlimited
1279+permission to run the unmodified Program. The output from running a
1280+covered work is covered by this License only if the output, given its
1281+content, constitutes a covered work. This License acknowledges your
1282+rights of fair use or other equivalent, as provided by copyright law.
1283+
1284+ You may make, run and propagate covered works that you do not
1285+convey, without conditions so long as your license otherwise remains
1286+in force. You may convey covered works to others for the sole purpose
1287+of having them make modifications exclusively for you, or provide you
1288+with facilities for running those works, provided that you comply with
1289+the terms of this License in conveying all material for which you do
1290+not control copyright. Those thus making or running the covered works
1291+for you must do so exclusively on your behalf, under your direction
1292+and control, on terms that prohibit them from making any copies of
1293+your copyrighted material outside their relationship with you.
1294+
1295+ Conveying under any other circumstances is permitted solely under
1296+the conditions stated below. Sublicensing is not allowed; section 10
1297+makes it unnecessary.
1298+
1299+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
1300+
1301+ No covered work shall be deemed part of an effective technological
1302+measure under any applicable law fulfilling obligations under article
1303+11 of the WIPO copyright treaty adopted on 20 December 1996, or
1304+similar laws prohibiting or restricting circumvention of such
1305+measures.
1306+
1307+ When you convey a covered work, you waive any legal power to forbid
1308+circumvention of technological measures to the extent such circumvention
1309+is effected by exercising rights under this License with respect to
1310+the covered work, and you disclaim any intention to limit operation or
1311+modification of the work as a means of enforcing, against the work's
1312+users, your or third parties' legal rights to forbid circumvention of
1313+technological measures.
1314+
1315+ 4. Conveying Verbatim Copies.
1316+
1317+ You may convey verbatim copies of the Program's source code as you
1318+receive it, in any medium, provided that you conspicuously and
1319+appropriately publish on each copy an appropriate copyright notice;
1320+keep intact all notices stating that this License and any
1321+non-permissive terms added in accord with section 7 apply to the code;
1322+keep intact all notices of the absence of any warranty; and give all
1323+recipients a copy of this License along with the Program.
1324+
1325+ You may charge any price or no price for each copy that you convey,
1326+and you may offer support or warranty protection for a fee.
1327+
1328+ 5. Conveying Modified Source Versions.
1329+
1330+ You may convey a work based on the Program, or the modifications to
1331+produce it from the Program, in the form of source code under the
1332+terms of section 4, provided that you also meet all of these conditions:
1333+
1334+ a) The work must carry prominent notices stating that you modified
1335+ it, and giving a relevant date.
1336+
1337+ b) The work must carry prominent notices stating that it is
1338+ released under this License and any conditions added under section
1339+ 7. This requirement modifies the requirement in section 4 to
1340+ "keep intact all notices".
1341+
1342+ c) You must license the entire work, as a whole, under this
1343+ License to anyone who comes into possession of a copy. This
1344+ License will therefore apply, along with any applicable section 7
1345+ additional terms, to the whole of the work, and all its parts,
1346+ regardless of how they are packaged. This License gives no
1347+ permission to license the work in any other way, but it does not
1348+ invalidate such permission if you have separately received it.
1349+
1350+ d) If the work has interactive user interfaces, each must display
1351+ Appropriate Legal Notices; however, if the Program has interactive
1352+ interfaces that do not display Appropriate Legal Notices, your
1353+ work need not make them do so.
1354+
1355+ A compilation of a covered work with other separate and independent
1356+works, which are not by their nature extensions of the covered work,
1357+and which are not combined with it such as to form a larger program,
1358+in or on a volume of a storage or distribution medium, is called an
1359+"aggregate" if the compilation and its resulting copyright are not
1360+used to limit the access or legal rights of the compilation's users
1361+beyond what the individual works permit. Inclusion of a covered work
1362+in an aggregate does not cause this License to apply to the other
1363+parts of the aggregate.
1364+
1365+ 6. Conveying Non-Source Forms.
1366+
1367+ You may convey a covered work in object code form under the terms
1368+of sections 4 and 5, provided that you also convey the
1369+machine-readable Corresponding Source under the terms of this License,
1370+in one of these ways:
1371+
1372+ a) Convey the object code in, or embodied in, a physical product
1373+ (including a physical distribution medium), accompanied by the
1374+ Corresponding Source fixed on a durable physical medium
1375+ customarily used for software interchange.
1376+
1377+ b) Convey the object code in, or embodied in, a physical product
1378+ (including a physical distribution medium), accompanied by a
1379+ written offer, valid for at least three years and valid for as
1380+ long as you offer spare parts or customer support for that product
1381+ model, to give anyone who possesses the object code either (1) a
1382+ copy of the Corresponding Source for all the software in the
1383+ product that is covered by this License, on a durable physical
1384+ medium customarily used for software interchange, for a price no
1385+ more than your reasonable cost of physically performing this
1386+ conveying of source, or (2) access to copy the
1387+ Corresponding Source from a network server at no charge.
1388+
1389+ c) Convey individual copies of the object code with a copy of the
1390+ written offer to provide the Corresponding Source. This
1391+ alternative is allowed only occasionally and noncommercially, and
1392+ only if you received the object code with such an offer, in accord
1393+ with subsection 6b.
1394+
1395+ d) Convey the object code by offering access from a designated
1396+ place (gratis or for a charge), and offer equivalent access to the
1397+ Corresponding Source in the same way through the same place at no
1398+ further charge. You need not require recipients to copy the
1399+ Corresponding Source along with the object code. If the place to
1400+ copy the object code is a network server, the Corresponding Source
1401+ may be on a different server (operated by you or a third party)
1402+ that supports equivalent copying facilities, provided you maintain
1403+ clear directions next to the object code saying where to find the
1404+ Corresponding Source. Regardless of what server hosts the
1405+ Corresponding Source, you remain obligated to ensure that it is
1406+ available for as long as needed to satisfy these requirements.
1407+
1408+ e) Convey the object code using peer-to-peer transmission, provided
1409+ you inform other peers where the object code and Corresponding
1410+ Source of the work are being offered to the general public at no
1411+ charge under subsection 6d.
1412+
1413+ A separable portion of the object code, whose source code is excluded
1414+from the Corresponding Source as a System Library, need not be
1415+included in conveying the object code work.
1416+
1417+ A "User Product" is either (1) a "consumer product", which means any
1418+tangible personal property which is normally used for personal, family,
1419+or household purposes, or (2) anything designed or sold for incorporation
1420+into a dwelling. In determining whether a product is a consumer product,
1421+doubtful cases shall be resolved in favor of coverage. For a particular
1422+product received by a particular user, "normally used" refers to a
1423+typical or common use of that class of product, regardless of the status
1424+of the particular user or of the way in which the particular user
1425+actually uses, or expects or is expected to use, the product. A product
1426+is a consumer product regardless of whether the product has substantial
1427+commercial, industrial or non-consumer uses, unless such uses represent
1428+the only significant mode of use of the product.
1429+
1430+ "Installation Information" for a User Product means any methods,
1431+procedures, authorization keys, or other information required to install
1432+and execute modified versions of a covered work in that User Product from
1433+a modified version of its Corresponding Source. The information must
1434+suffice to ensure that the continued functioning of the modified object
1435+code is in no case prevented or interfered with solely because
1436+modification has been made.
1437+
1438+ If you convey an object code work under this section in, or with, or
1439+specifically for use in, a User Product, and the conveying occurs as
1440+part of a transaction in which the right of possession and use of the
1441+User Product is transferred to the recipient in perpetuity or for a
1442+fixed term (regardless of how the transaction is characterized), the
1443+Corresponding Source conveyed under this section must be accompanied
1444+by the Installation Information. But this requirement does not apply
1445+if neither you nor any third party retains the ability to install
1446+modified object code on the User Product (for example, the work has
1447+been installed in ROM).
1448+
1449+ The requirement to provide Installation Information does not include a
1450+requirement to continue to provide support service, warranty, or updates
1451+for a work that has been modified or installed by the recipient, or for
1452+the User Product in which it has been modified or installed. Access to a
1453+network may be denied when the modification itself materially and
1454+adversely affects the operation of the network or violates the rules and
1455+protocols for communication across the network.
1456+
1457+ Corresponding Source conveyed, and Installation Information provided,
1458+in accord with this section must be in a format that is publicly
1459+documented (and with an implementation available to the public in
1460+source code form), and must require no special password or key for
1461+unpacking, reading or copying.
1462+
1463+ 7. Additional Terms.
1464+
1465+ "Additional permissions" are terms that supplement the terms of this
1466+License by making exceptions from one or more of its conditions.
1467+Additional permissions that are applicable to the entire Program shall
1468+be treated as though they were included in this License, to the extent
1469+that they are valid under applicable law. If additional permissions
1470+apply only to part of the Program, that part may be used separately
1471+under those permissions, but the entire Program remains governed by
1472+this License without regard to the additional permissions.
1473+
1474+ When you convey a copy of a covered work, you may at your option
1475+remove any additional permissions from that copy, or from any part of
1476+it. (Additional permissions may be written to require their own
1477+removal in certain cases when you modify the work.) You may place
1478+additional permissions on material, added by you to a covered work,
1479+for which you have or can give appropriate copyright permission.
1480+
1481+ Notwithstanding any other provision of this License, for material you
1482+add to a covered work, you may (if authorized by the copyright holders of
1483+that material) supplement the terms of this License with terms:
1484+
1485+ a) Disclaiming warranty or limiting liability differently from the
1486+ terms of sections 15 and 16 of this License; or
1487+
1488+ b) Requiring preservation of specified reasonable legal notices or
1489+ author attributions in that material or in the Appropriate Legal
1490+ Notices displayed by works containing it; or
1491+
1492+ c) Prohibiting misrepresentation of the origin of that material, or
1493+ requiring that modified versions of such material be marked in
1494+ reasonable ways as different from the original version; or
1495+
1496+ d) Limiting the use for publicity purposes of names of licensors or
1497+ authors of the material; or
1498+
1499+ e) Declining to grant rights under trademark law for use of some
1500+ trade names, trademarks, or service marks; or
1501+
1502+ f) Requiring indemnification of licensors and authors of that
1503+ material by anyone who conveys the material (or modified versions of
1504+ it) with contractual assumptions of liability to the recipient, for
1505+ any liability that these contractual assumptions directly impose on
1506+ those licensors and authors.
1507+
1508+ All other non-permissive additional terms are considered "further
1509+restrictions" within the meaning of section 10. If the Program as you
1510+received it, or any part of it, contains a notice stating that it is
1511+governed by this License along with a term that is a further
1512+restriction, you may remove that term. If a license document contains
1513+a further restriction but permits relicensing or conveying under this
1514+License, you may add to a covered work material governed by the terms
1515+of that license document, provided that the further restriction does
1516+not survive such relicensing or conveying.
1517+
1518+ If you add terms to a covered work in accord with this section, you
1519+must place, in the relevant source files, a statement of the
1520+additional terms that apply to those files, or a notice indicating
1521+where to find the applicable terms.
1522+
1523+ Additional terms, permissive or non-permissive, may be stated in the
1524+form of a separately written license, or stated as exceptions;
1525+the above requirements apply either way.
1526+
1527+ 8. Termination.
1528+
1529+ You may not propagate or modify a covered work except as expressly
1530+provided under this License. Any attempt otherwise to propagate or
1531+modify it is void, and will automatically terminate your rights under
1532+this License (including any patent licenses granted under the third
1533+paragraph of section 11).
1534+
1535+ However, if you cease all violation of this License, then your
1536+license from a particular copyright holder is reinstated (a)
1537+provisionally, unless and until the copyright holder explicitly and
1538+finally terminates your license, and (b) permanently, if the copyright
1539+holder fails to notify you of the violation by some reasonable means
1540+prior to 60 days after the cessation.
1541+
1542+ Moreover, your license from a particular copyright holder is
1543+reinstated permanently if the copyright holder notifies you of the
1544+violation by some reasonable means, this is the first time you have
1545+received notice of violation of this License (for any work) from that
1546+copyright holder, and you cure the violation prior to 30 days after
1547+your receipt of the notice.
1548+
1549+ Termination of your rights under this section does not terminate the
1550+licenses of parties who have received copies or rights from you under
1551+this License. If your rights have been terminated and not permanently
1552+reinstated, you do not qualify to receive new licenses for the same
1553+material under section 10.
1554+
1555+ 9. Acceptance Not Required for Having Copies.
1556+
1557+ You are not required to accept this License in order to receive or
1558+run a copy of the Program. Ancillary propagation of a covered work
1559+occurring solely as a consequence of using peer-to-peer transmission
1560+to receive a copy likewise does not require acceptance. However,
1561+nothing other than this License grants you permission to propagate or
1562+modify any covered work. These actions infringe copyright if you do
1563+not accept this License. Therefore, by modifying or propagating a
1564+covered work, you indicate your acceptance of this License to do so.
1565+
1566+ 10. Automatic Licensing of Downstream Recipients.
1567+
1568+ Each time you convey a covered work, the recipient automatically
1569+receives a license from the original licensors, to run, modify and
1570+propagate that work, subject to this License. You are not responsible
1571+for enforcing compliance by third parties with this License.
1572+
1573+ An "entity transaction" is a transaction transferring control of an
1574+organization, or substantially all assets of one, or subdividing an
1575+organization, or merging organizations. If propagation of a covered
1576+work results from an entity transaction, each party to that
1577+transaction who receives a copy of the work also receives whatever
1578+licenses to the work the party's predecessor in interest had or could
1579+give under the previous paragraph, plus a right to possession of the
1580+Corresponding Source of the work from the predecessor in interest, if
1581+the predecessor has it or can get it with reasonable efforts.
1582+
1583+ You may not impose any further restrictions on the exercise of the
1584+rights granted or affirmed under this License. For example, you may
1585+not impose a license fee, royalty, or other charge for exercise of
1586+rights granted under this License, and you may not initiate litigation
1587+(including a cross-claim or counterclaim in a lawsuit) alleging that
1588+any patent claim is infringed by making, using, selling, offering for
1589+sale, or importing the Program or any portion of it.
1590+
1591+ 11. Patents.
1592+
1593+ A "contributor" is a copyright holder who authorizes use under this
1594+License of the Program or a work on which the Program is based. The
1595+work thus licensed is called the contributor's "contributor version".
1596+
1597+ A contributor's "essential patent claims" are all patent claims
1598+owned or controlled by the contributor, whether already acquired or
1599+hereafter acquired, that would be infringed by some manner, permitted
1600+by this License, of making, using, or selling its contributor version,
1601+but do not include claims that would be infringed only as a
1602+consequence of further modification of the contributor version. For
1603+purposes of this definition, "control" includes the right to grant
1604+patent sublicenses in a manner consistent with the requirements of
1605+this License.
1606+
1607+ Each contributor grants you a non-exclusive, worldwide, royalty-free
1608+patent license under the contributor's essential patent claims, to
1609+make, use, sell, offer for sale, import and otherwise run, modify and
1610+propagate the contents of its contributor version.
1611+
1612+ In the following three paragraphs, a "patent license" is any express
1613+agreement or commitment, however denominated, not to enforce a patent
1614+(such as an express permission to practice a patent or covenant not to
1615+sue for patent infringement). To "grant" such a patent license to a
1616+party means to make such an agreement or commitment not to enforce a
1617+patent against the party.
1618+
1619+ If you convey a covered work, knowingly relying on a patent license,
1620+and the Corresponding Source of the work is not available for anyone
1621+to copy, free of charge and under the terms of this License, through a
1622+publicly available network server or other readily accessible means,
1623+then you must either (1) cause the Corresponding Source to be so
1624+available, or (2) arrange to deprive yourself of the benefit of the
1625+patent license for this particular work, or (3) arrange, in a manner
1626+consistent with the requirements of this License, to extend the patent
1627+license to downstream recipients. "Knowingly relying" means you have
1628+actual knowledge that, but for the patent license, your conveying the
1629+covered work in a country, or your recipient's use of the covered work
1630+in a country, would infringe one or more identifiable patents in that
1631+country that you have reason to believe are valid.
1632+
1633+ If, pursuant to or in connection with a single transaction or
1634+arrangement, you convey, or propagate by procuring conveyance of, a
1635+covered work, and grant a patent license to some of the parties
1636+receiving the covered work authorizing them to use, propagate, modify
1637+or convey a specific copy of the covered work, then the patent license
1638+you grant is automatically extended to all recipients of the covered
1639+work and works based on it.
1640+
1641+ A patent license is "discriminatory" if it does not include within
1642+the scope of its coverage, prohibits the exercise of, or is
1643+conditioned on the non-exercise of one or more of the rights that are
1644+specifically granted under this License. You may not convey a covered
1645+work if you are a party to an arrangement with a third party that is
1646+in the business of distributing software, under which you make payment
1647+to the third party based on the extent of your activity of conveying
1648+the work, and under which the third party grants, to any of the
1649+parties who would receive the covered work from you, a discriminatory
1650+patent license (a) in connection with copies of the covered work
1651+conveyed by you (or copies made from those copies), or (b) primarily
1652+for and in connection with specific products or compilations that
1653+contain the covered work, unless you entered into that arrangement,
1654+or that patent license was granted, prior to 28 March 2007.
1655+
1656+ Nothing in this License shall be construed as excluding or limiting
1657+any implied license or other defenses to infringement that may
1658+otherwise be available to you under applicable patent law.
1659+
1660+ 12. No Surrender of Others' Freedom.
1661+
1662+ If conditions are imposed on you (whether by court order, agreement or
1663+otherwise) that contradict the conditions of this License, they do not
1664+excuse you from the conditions of this License. If you cannot convey a
1665+covered work so as to satisfy simultaneously your obligations under this
1666+License and any other pertinent obligations, then as a consequence you may
1667+not convey it at all. For example, if you agree to terms that obligate you
1668+to collect a royalty for further conveying from those to whom you convey
1669+the Program, the only way you could satisfy both those terms and this
1670+License would be to refrain entirely from conveying the Program.
1671+
1672+ 13. Use with the GNU Affero General Public License.
1673+
1674+ Notwithstanding any other provision of this License, you have
1675+permission to link or combine any covered work with a work licensed
1676+under version 3 of the GNU Affero General Public License into a single
1677+combined work, and to convey the resulting work. The terms of this
1678+License will continue to apply to the part which is the covered work,
1679+but the special requirements of the GNU Affero General Public License,
1680+section 13, concerning interaction through a network will apply to the
1681+combination as such.
1682+
1683+ 14. Revised Versions of this License.
1684+
1685+ The Free Software Foundation may publish revised and/or new versions of
1686+the GNU General Public License from time to time. Such new versions will
1687+be similar in spirit to the present version, but may differ in detail to
1688+address new problems or concerns.
1689+
1690+ Each version is given a distinguishing version number. If the
1691+Program specifies that a certain numbered version of the GNU General
1692+Public License "or any later version" applies to it, you have the
1693+option of following the terms and conditions either of that numbered
1694+version or of any later version published by the Free Software
1695+Foundation. If the Program does not specify a version number of the
1696+GNU General Public License, you may choose any version ever published
1697+by the Free Software Foundation.
1698+
1699+ If the Program specifies that a proxy can decide which future
1700+versions of the GNU General Public License can be used, that proxy's
1701+public statement of acceptance of a version permanently authorizes you
1702+to choose that version for the Program.
1703+
1704+ Later license versions may give you additional or different
1705+permissions. However, no additional obligations are imposed on any
1706+author or copyright holder as a result of your choosing to follow a
1707+later version.
1708+
1709+ 15. Disclaimer of Warranty.
1710+
1711+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
1712+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
1713+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
1714+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
1715+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1716+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
1717+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
1718+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
1719+
1720+ 16. Limitation of Liability.
1721+
1722+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1723+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
1724+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
1725+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
1726+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
1727+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
1728+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
1729+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
1730+SUCH DAMAGES.
1731+
1732+ 17. Interpretation of Sections 15 and 16.
1733+
1734+ If the disclaimer of warranty and limitation of liability provided
1735+above cannot be given local legal effect according to their terms,
1736+reviewing courts shall apply local law that most closely approximates
1737+an absolute waiver of all civil liability in connection with the
1738+Program, unless a warranty or assumption of liability accompanies a
1739+copy of the Program in return for a fee.
1740+
1741+ END OF TERMS AND CONDITIONS
1742+
1743+ How to Apply These Terms to Your New Programs
1744+
1745+ If you develop a new program, and you want it to be of the greatest
1746+possible use to the public, the best way to achieve this is to make it
1747+free software which everyone can redistribute and change under these terms.
1748+
1749+ To do so, attach the following notices to the program. It is safest
1750+to attach them to the start of each source file to most effectively
1751+state the exclusion of warranty; and each file should have at least
1752+the "copyright" line and a pointer to where the full notice is found.
1753+
1754+ <one line to give the program's name and a brief idea of what it does.>
1755+ Copyright (C) <year> <name of author>
1756+
1757+ This program is free software: you can redistribute it and/or modify
1758+ it under the terms of the GNU General Public License as published by
1759+ the Free Software Foundation, either version 3 of the License, or
1760+ (at your option) any later version.
1761+
1762+ This program is distributed in the hope that it will be useful,
1763+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1764+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1765+ GNU General Public License for more details.
1766+
1767+ You should have received a copy of the GNU General Public License
1768+ along with this program. If not, see <http://www.gnu.org/licenses/>.
1769+
1770+Also add information on how to contact you by electronic and paper mail.
1771+
1772+ If the program does terminal interaction, make it output a short
1773+notice like this when it starts in an interactive mode:
1774+
1775+ <program> Copyright (C) <year> <name of author>
1776+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1777+ This is free software, and you are welcome to redistribute it
1778+ under certain conditions; type `show c' for details.
1779+
1780+The hypothetical commands `show w' and `show c' should show the appropriate
1781+parts of the General Public License. Of course, your program's commands
1782+might be different; for a GUI interface, you would use an "about box".
1783+
1784+ You should also get your employer (if you work as a programmer) or school,
1785+if any, to sign a "copyright disclaimer" for the program, if necessary.
1786+For more information on this, and how to apply and follow the GNU GPL, see
1787+<http://www.gnu.org/licenses/>.
1788+
1789+ The GNU General Public License does not permit incorporating your program
1790+into proprietary programs. If your program is a subroutine library, you
1791+may consider it more useful to permit linking proprietary applications with
1792+the library. If this is what you want to do, use the GNU Lesser General
1793+Public License instead of this License. But first, please read
1794+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
1795diff --git a/Makefile b/Makefile
1796index 5d35dcc..5940ed7 100644
1797--- a/Makefile
1798+++ b/Makefile
1799@@ -27,13 +27,16 @@ ifeq ($(distro),)
1800 distro = redhat
1801 endif
1802
1803-READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version)
1804+READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version || \
1805+ echo read-version-failed)
1806 CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.version_string())")
1807
1808
1809 all: check
1810
1811-check: check_version pep8 $(pyflakes) test $(yaml)
1812+check: check_version test $(yaml)
1813+
1814+style-check: pep8 $(pyflakes)
1815
1816 pep8:
1817 @$(CWD)/tools/run-pep8
1818@@ -62,8 +65,8 @@ test: $(unittests)
1819
1820 check_version:
1821 @if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \
1822- echo "Error: read-version version $(READ_VERSION)" \
1823- "not equal to code version $(CODE_VERSION)"; exit 2; \
1824+ echo "Error: read-version version '$(READ_VERSION)'" \
1825+ "not equal to code version '$(CODE_VERSION)'"; exit 2; \
1826 else true; fi
1827
1828 clean_pyc:
1829@@ -73,7 +76,7 @@ clean: clean_pyc
1830 rm -rf /var/log/cloud-init.log /var/lib/cloud/
1831
1832 yaml:
1833- @$(CWD)/tools/validate-yaml.py $(YAML_FILES)
1834+ @$(PYVER) $(CWD)/tools/validate-yaml.py $(YAML_FILES)
1835
1836 rpm:
1837 ./packages/brpm --distro $(distro)
1838@@ -83,3 +86,4 @@ deb:
1839
1840 .PHONY: test pyflakes pyflakes3 clean pep8 rpm deb yaml check_version
1841 .PHONY: pip-test-requirements pip-requirements clean_pyc unittest unittest3
1842+.PHONY: style-check
1843diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
1844index da12464..e69de29 100644
1845--- a/cloudinit/__init__.py
1846+++ b/cloudinit/__init__.py
1847@@ -1,21 +0,0 @@
1848-# vi: ts=4 expandtab
1849-#
1850-# Copyright (C) 2012 Canonical Ltd.
1851-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1852-# Copyright (C) 2012 Yahoo! Inc.
1853-#
1854-# Author: Scott Moser <scott.moser@canonical.com>
1855-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
1856-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
1857-#
1858-# This program is free software: you can redistribute it and/or modify
1859-# it under the terms of the GNU General Public License version 3, as
1860-# published by the Free Software Foundation.
1861-#
1862-# This program is distributed in the hope that it will be useful,
1863-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1864-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1865-# GNU General Public License for more details.
1866-#
1867-# You should have received a copy of the GNU General Public License
1868-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1869diff --git a/cloudinit/atomic_helper.py b/cloudinit/atomic_helper.py
1870index a3cfd94..fb2df8d 100644
1871--- a/cloudinit/atomic_helper.py
1872+++ b/cloudinit/atomic_helper.py
1873@@ -1,5 +1,4 @@
1874-#!/usr/bin/python
1875-# vi: ts=4 expandtab
1876+# This file is part of cloud-init. See LICENSE file for license information.
1877
1878 import json
1879 import os
1880@@ -29,3 +28,5 @@ def write_json(filename, data, mode=_DEF_PERMS):
1881 return write_file(
1882 filename, json.dumps(data, indent=1, sort_keys=True) + "\n",
1883 omode="w", mode=mode)
1884+
1885+# vi: ts=4 expandtab
1886diff --git a/cloudinit/cloud.py b/cloudinit/cloud.py
1887index 3e6be20..b93a42e 100644
1888--- a/cloudinit/cloud.py
1889+++ b/cloudinit/cloud.py
1890@@ -1,24 +1,8 @@
1891-# vi: ts=4 expandtab
1892-#
1893-# Copyright (C) 2012 Canonical Ltd.
1894-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1895-# Copyright (C) 2012 Yahoo! Inc.
1896-#
1897-# Author: Scott Moser <scott.moser@canonical.com>
1898-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
1899-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
1900-#
1901-# This program is free software: you can redistribute it and/or modify
1902-# it under the terms of the GNU General Public License version 3, as
1903-# published by the Free Software Foundation.
1904+# Copyright (C) 2012 Canonical Ltd.
1905+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1906+# Copyright (C) 2012 Yahoo! Inc.
1907 #
1908-# This program is distributed in the hope that it will be useful,
1909-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1910-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1911-# GNU General Public License for more details.
1912-#
1913-# You should have received a copy of the GNU General Public License
1914-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1915+# This file is part of cloud-init. See LICENSE file for license information.
1916
1917 import copy
1918 import os
1919@@ -107,3 +91,5 @@ class Cloud(object):
1920
1921 def get_ipath(self, name=None):
1922 return self.paths.get_ipath(name)
1923+
1924+# vi: ts=4 expandtab
1925diff --git a/cloudinit/cmd/__init__.py b/cloudinit/cmd/__init__.py
1926index da12464..e69de29 100644
1927--- a/cloudinit/cmd/__init__.py
1928+++ b/cloudinit/cmd/__init__.py
1929@@ -1,21 +0,0 @@
1930-# vi: ts=4 expandtab
1931-#
1932-# Copyright (C) 2012 Canonical Ltd.
1933-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1934-# Copyright (C) 2012 Yahoo! Inc.
1935-#
1936-# Author: Scott Moser <scott.moser@canonical.com>
1937-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
1938-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
1939-#
1940-# This program is free software: you can redistribute it and/or modify
1941-# it under the terms of the GNU General Public License version 3, as
1942-# published by the Free Software Foundation.
1943-#
1944-# This program is distributed in the hope that it will be useful,
1945-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1946-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1947-# GNU General Public License for more details.
1948-#
1949-# You should have received a copy of the GNU General Public License
1950-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1951diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
1952index 83eb02c..fd22132 100644
1953--- a/cloudinit/cmd/main.py
1954+++ b/cloudinit/cmd/main.py
1955@@ -1,25 +1,14 @@
1956 #!/usr/bin/python
1957-# vi: ts=4 expandtab
1958-#
1959-# Copyright (C) 2012 Canonical Ltd.
1960-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1961-# Copyright (C) 2012 Yahoo! Inc.
1962-#
1963-# Author: Scott Moser <scott.moser@canonical.com>
1964-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
1965-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
1966 #
1967-# This program is free software: you can redistribute it and/or modify
1968-# it under the terms of the GNU General Public License version 3, as
1969-# published by the Free Software Foundation.
1970+# Copyright (C) 2012 Canonical Ltd.
1971+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
1972+# Copyright (C) 2012 Yahoo! Inc.
1973 #
1974-# This program is distributed in the hope that it will be useful,
1975-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1976-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1977-# GNU General Public License for more details.
1978+# Author: Scott Moser <scott.moser@canonical.com>
1979+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
1980+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
1981 #
1982-# You should have received a copy of the GNU General Public License
1983-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1984+# This file is part of cloud-init. See LICENSE file for license information.
1985
1986 import argparse
1987 import json
1988@@ -37,8 +26,10 @@ from cloudinit import signal_handler
1989 from cloudinit import sources
1990 from cloudinit import stages
1991 from cloudinit import templater
1992+from cloudinit import url_helper
1993 from cloudinit import util
1994 from cloudinit import version
1995+from cloudinit import warnings
1996
1997 from cloudinit import reporting
1998 from cloudinit.reporting import events
1999@@ -140,23 +131,104 @@ def apply_reporting_cfg(cfg):
2000 reporting.update_configuration(cfg.get('reporting'))
2001
2002
2003+def parse_cmdline_url(cmdline, names=('cloud-config-url', 'url')):
2004+ data = util.keyval_str_to_dict(cmdline)
2005+ for key in names:
2006+ if key in data:
2007+ return key, data[key]
2008+ raise KeyError("No keys (%s) found in string '%s'" %
2009+ (cmdline, names))
2010+
2011+
2012+def attempt_cmdline_url(path, network=True, cmdline=None):
2013+ """Write data from url referenced in command line to path.
2014+
2015+ path: a file to write content to if downloaded.
2016+ network: should network access be assumed.
2017+ cmdline: the cmdline to parse for cloud-config-url.
2018+
2019+ This is used in MAAS datasource, in "ephemeral" (read-only root)
2020+ environment where the instance netboots to iscsi ro root.
2021+ and the entity that controls the pxe config has to configure
2022+ the maas datasource.
2023+
2024+ An attempt is made on network urls even in local datasource
2025+ for case of network set up in initramfs.
2026+
2027+ Return value is a tuple of a logger function (logging.DEBUG)
2028+ and a message indicating what happened.
2029+ """
2030+
2031+ if cmdline is None:
2032+ cmdline = util.get_cmdline()
2033+
2034+ try:
2035+ cmdline_name, url = parse_cmdline_url(cmdline)
2036+ except KeyError:
2037+ return (logging.DEBUG, "No kernel command line url found.")
2038+
2039+ path_is_local = url.startswith("file://") or url.startswith("/")
2040+
2041+ if path_is_local and os.path.exists(path):
2042+ if network:
2043+ m = ("file '%s' existed, possibly from local stage download"
2044+ " of command line url '%s'. Not re-writing." % (path, url))
2045+ level = logging.INFO
2046+ if path_is_local:
2047+ level = logging.DEBUG
2048+ else:
2049+ m = ("file '%s' existed, possibly from previous boot download"
2050+ " of command line url '%s'. Not re-writing." % (path, url))
2051+ level = logging.WARN
2052+
2053+ return (level, m)
2054+
2055+ kwargs = {'url': url, 'timeout': 10, 'retries': 2}
2056+ if network or path_is_local:
2057+ level = logging.WARN
2058+ kwargs['sec_between'] = 1
2059+ else:
2060+ level = logging.DEBUG
2061+ kwargs['sec_between'] = .1
2062+
2063+ data = None
2064+ header = b'#cloud-config'
2065+ try:
2066+ resp = util.read_file_or_url(**kwargs)
2067+ if resp.ok():
2068+ data = resp.contents
2069+ if not resp.contents.startswith(header):
2070+ if cmdline_name == 'cloud-config-url':
2071+ level = logging.WARN
2072+ else:
2073+ level = logging.INFO
2074+ return (
2075+ level,
2076+ "contents of '%s' did not start with %s" % (url, header))
2077+ else:
2078+ return (level,
2079+ "url '%s' returned code %s. Ignoring." % (url, resp.code))
2080+
2081+ except url_helper.UrlError as e:
2082+ return (level, "retrieving url '%s' failed: %s" % (url, e))
2083+
2084+ util.write_file(path, data, mode=0o600)
2085+ return (logging.INFO,
2086+ "wrote cloud-config data from %s='%s' to %s" %
2087+ (cmdline_name, url, path))
2088+
2089+
2090 def main_init(name, args):
2091 deps = [sources.DEP_FILESYSTEM, sources.DEP_NETWORK]
2092 if args.local:
2093 deps = [sources.DEP_FILESYSTEM]
2094
2095- if not args.local:
2096- # See doc/kernel-cmdline.txt
2097- #
2098- # This is used in maas datasource, in "ephemeral" (read-only root)
2099- # environment where the instance netboots to iscsi ro root.
2100- # and the entity that controls the pxe config has to configure
2101- # the maas datasource.
2102- #
2103- # Could be used elsewhere, only works on network based (not local).
2104- root_name = "%s.d" % (CLOUD_CONFIG)
2105- target_fn = os.path.join(root_name, "91_kernel_cmdline_url.cfg")
2106- util.read_write_cmdline_url(target_fn)
2107+ early_logs = []
2108+ early_logs.append(
2109+ attempt_cmdline_url(
2110+ path=os.path.join("%s.d" % CLOUD_CONFIG,
2111+ "91_kernel_cmdline_url.cfg"),
2112+ network=not args.local))
2113
2114 # Cloud-init 'init' stage is broken up into the following sub-stages
2115 # 1. Ensure that the init object fetches its config without errors
2116@@ -182,12 +254,14 @@ def main_init(name, args):
2117 outfmt = None
2118 errfmt = None
2119 try:
2120- LOG.debug("Closing stdin")
2121+ early_logs.append((logging.DEBUG, "Closing stdin."))
2122 util.close_stdin()
2123 (outfmt, errfmt) = util.fixup_output(init.cfg, name)
2124 except Exception:
2125- util.logexc(LOG, "Failed to setup output redirection!")
2126- print_exc("Failed to setup output redirection!")
2127+ msg = "Failed to setup output redirection!"
2128+ util.logexc(LOG, msg)
2129+ print_exc(msg)
2130+ early_logs.append((logging.WARN, msg))
2131 if args.debug:
2132 # Reset so that all the debug handlers are closed out
2133 LOG.debug(("Logging being reset, this logger may no"
2134@@ -201,6 +275,10 @@ def main_init(name, args):
2135 # been redirected and log now configured.
2136 welcome(name, msg=w_msg)
2137
2138+ # re-play early log messages before logging was setup
2139+ for lvl, msg in early_logs:
2140+ LOG.log(lvl, msg)
2141+
2142 # Stage 3
2143 try:
2144 init.initialize()
2145@@ -235,8 +313,15 @@ def main_init(name, args):
2146 " would allow us to stop early.")
2147 else:
2148 existing = "check"
2149- if util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False):
2150+ mcfg = util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False)
2151+ if mcfg:
2152+ LOG.debug("manual cache clean set from config")
2153 existing = "trust"
2154+ else:
2155+ mfile = path_helper.get_ipath_cur("manual_clean_marker")
2156+ if os.path.exists(mfile):
2157+ LOG.debug("manual cache clean found from marker: %s", mfile)
2158+ existing = "trust"
2159
2160 init.purge_cache()
2161 # Delete the non-net file as well
2162@@ -326,10 +411,51 @@ def main_init(name, args):
2163 util.logexc(LOG, "Failed to re-adjust output redirection!")
2164 logging.setupLogging(mods.cfg)
2165
2166+ # give the activated datasource a chance to adjust
2167+ init.activate_datasource()
2168+
2169+ di_report_warn(datasource=init.datasource, cfg=init.cfg)
2170+
2171 # Stage 10
2172 return (init.datasource, run_module_section(mods, name, name))
2173
2174
2175+def di_report_warn(datasource, cfg):
2176+ if 'di_report' not in cfg:
2177+ LOG.debug("no di_report found in config.")
2178+ return
2179+
2180+ dicfg = cfg.get('di_report', {})
2181+ if not isinstance(dicfg, dict):
2182+ LOG.warn("di_report config not a dictionary: %s", dicfg)
2183+ return
2184+
2185+ dslist = dicfg.get('datasource_list')
2186+ if dslist is None:
2187+ LOG.warn("no 'datasource_list' found in di_report.")
2188+ return
2189+ elif not isinstance(dslist, list):
2190+ LOG.warn("di_report/datasource_list not a list: %s", dslist)
2191+ return
2192+
2193+ # ds.__module__ is like cloudinit.sources.DataSourceName
2194+ # where Name is the thing that shows up in datasource_list.
2195+ modname = datasource.__module__.rpartition(".")[2]
2196+ if modname.startswith(sources.DS_PREFIX):
2197+ modname = modname[len(sources.DS_PREFIX):]
2198+ else:
2199+ LOG.warn("Datasource '%s' came from unexpected module '%s'.",
2200+ datasource, modname)
2201+
2202+ if modname in dslist:
2203+ LOG.debug("used datasource '%s' from '%s' was in di_report's list: %s",
2204+ datasource, modname, dslist)
2205+ return
2206+
2207+ warnings.show_warning('dsid_missing_source', cfg,
2208+ source=modname, dslist=str(dslist))
2209+
2210+
2211 def main_modules(action_name, args):
2212 name = args.mode
2213 # Cloud-init 'modules' stages are broken up into the following sub-stages
2214@@ -554,6 +680,10 @@ def status_wrapper(name, args, data_d=None, link_d=None):
2215 return len(v1[mode]['errors'])
2216
2217
2218+def main_features(name, args):
2219+ sys.stdout.write('\n'.join(sorted(version.FEATURES)) + '\n')
2220+
2221+
2222 def main(sysv_args=None):
2223 if sysv_args is not None:
2224 parser = argparse.ArgumentParser(prog=sysv_args[0])
2225@@ -644,6 +774,10 @@ def main(sysv_args=None):
2226 ' upon'))
2227 parser_dhclient.set_defaults(action=('dhclient_hook', dhclient_hook))
2228
2229+ parser_features = subparsers.add_parser('features',
2230+ help=('list defined features'))
2231+ parser_features.set_defaults(action=('features', main_features))
2232+
2233 args = parser.parse_args(args=sysv_args)
2234
2235 try:
2236@@ -662,6 +796,7 @@ def main(sysv_args=None):
2237 if name in ("modules", "init"):
2238 functor = status_wrapper
2239
2240+ rname = None
2241 report_on = True
2242 if name == "init":
2243 if args.local:
2244@@ -676,10 +811,10 @@ def main(sysv_args=None):
2245 rname, rdesc = ("single/%s" % args.name,
2246 "running single module %s" % args.name)
2247 report_on = args.report
2248-
2249- elif name == 'dhclient_hook':
2250- rname, rdesc = ("dhclient-hook",
2251- "running dhclient-hook module")
2252+ else:
2253+ rname = name
2254+ rdesc = "running 'cloud-init %s'" % name
2255+ report_on = False
2256
2257 args.reporter = events.ReportEventStack(
2258 rname, rdesc, reporting_enabled=report_on)
2259@@ -691,4 +826,8 @@ def main(sysv_args=None):
2260
2261
2262 if __name__ == '__main__':
2263+ if 'TZ' not in os.environ:
2264+ os.environ['TZ'] = ":/etc/localtime"
2265 main(sys.argv)
2266+
2267+# vi: ts=4 expandtab
2268diff --git a/cloudinit/config/__init__.py b/cloudinit/config/__init__.py
2269index d57453b..57e2a44 100644
2270--- a/cloudinit/config/__init__.py
2271+++ b/cloudinit/config/__init__.py
2272@@ -1,23 +1,10 @@
2273-# vi: ts=4 expandtab
2274-#
2275-# Copyright (C) 2008-2010 Canonical Ltd.
2276-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2277-#
2278-# Author: Chuck Short <chuck.short@canonical.com>
2279-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2280-#
2281-# This program is free software: you can redistribute it and/or modify
2282-# it under the terms of the GNU General Public License version 3, as
2283-# published by the Free Software Foundation.
2284+# Copyright (C) 2008-2010 Canonical Ltd.
2285+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2286 #
2287-# This program is distributed in the hope that it will be useful,
2288-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2289-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2290-# GNU General Public License for more details.
2291-#
2292-# You should have received a copy of the GNU General Public License
2293-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2294+# Author: Chuck Short <chuck.short@canonical.com>
2295+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2296 #
2297+# This file is part of cloud-init. See LICENSE file for license information.
2298
2299 from cloudinit.settings import (PER_INSTANCE, FREQUENCIES)
2300
2301@@ -56,3 +43,5 @@ def fixup_module(mod, def_freq=PER_INSTANCE):
2302 if not hasattr(mod, 'osfamilies'):
2303 setattr(mod, 'osfamilies', [])
2304 return mod
2305+
2306+# vi: ts=4 expandtab
2307diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
2308index 6145fcd..7f09c91 100644
2309--- a/cloudinit/config/cc_apt_configure.py
2310+++ b/cloudinit/config/cc_apt_configure.py
2311@@ -1,22 +1,10 @@
2312-# vi: ts=4 expandtab
2313-#
2314-# Copyright (C) 2009-2010 Canonical Ltd.
2315-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2316-#
2317-# Author: Scott Moser <scott.moser@canonical.com>
2318-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2319+# Copyright (C) 2009-2010 Canonical Ltd.
2320+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2321 #
2322-# This program is free software: you can redistribute it and/or modify
2323-# it under the terms of the GNU General Public License version 3, as
2324-# published by the Free Software Foundation.
2325+# Author: Scott Moser <scott.moser@canonical.com>
2326+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2327 #
2328-# This program is distributed in the hope that it will be useful,
2329-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2330-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2331-# GNU General Public License for more details.
2332-#
2333-# You should have received a copy of the GNU General Public License
2334-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2335+# This file is part of cloud-init. See LICENSE file for license information.
2336
2337 """
2338 Apt Configure
2339@@ -199,6 +187,8 @@ The ``source`` key supports variable replacements for the following strings:
2340 deb-src $MIRROR $RELEASE main restricted
2341 deb $PRIMARY $RELEASE universe restricted
2342 deb $SECURITY $RELEASE-security multiverse
2343+ debconf_selections:
2344+ set1: the-package the-package/some-flag boolean true
2345 conf: |
2346 APT {
2347 Get {
2348@@ -216,9 +206,9 @@ The ``source`` key supports variable replacements for the following strings:
2349 keyserver: "keyserverurl"
2350 source: "deb http://<url>/ xenial main"
2351 source2:
2352- source "ppa:<ppa-name>"
2353+ source: "ppa:<ppa-name>"
2354 source3:
2355- source "deb $MIRROR $RELEASE multiverse"
2356+ source: "deb $MIRROR $RELEASE multiverse"
2357 key: |
2358 ------BEGIN PGP PUBLIC KEY BLOCK-------
2359 <key data>
2360@@ -928,4 +918,4 @@ CONFIG_CLEANERS = {
2361 'cloud-init': clean_cloud_init,
2362 }
2363
2364-# vi: ts=4 expandtab syntax=python
2365+# vi: ts=4 expandtab
2366diff --git a/cloudinit/config/cc_apt_pipelining.py b/cloudinit/config/cc_apt_pipelining.py
2367index ab9d005..cdf28cd 100644
2368--- a/cloudinit/config/cc_apt_pipelining.py
2369+++ b/cloudinit/config/cc_apt_pipelining.py
2370@@ -1,20 +1,8 @@
2371-# vi: ts=4 expandtab
2372-#
2373-# Copyright (C) 2011 Canonical Ltd.
2374-#
2375-# Author: Ben Howard <ben.howard@canonical.com>
2376+# Copyright (C) 2011 Canonical Ltd.
2377 #
2378-# This program is free software: you can redistribute it and/or modify
2379-# it under the terms of the GNU General Public License version 3, as
2380-# published by the Free Software Foundation.
2381+# Author: Ben Howard <ben.howard@canonical.com>
2382 #
2383-# This program is distributed in the hope that it will be useful,
2384-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2385-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2386-# GNU General Public License for more details.
2387-#
2388-# You should have received a copy of the GNU General Public License
2389-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2390+# This file is part of cloud-init. See LICENSE file for license information.
2391
2392 """
2393 Apt Pipelining
2394@@ -80,3 +68,5 @@ def write_apt_snippet(setting, log, f_name):
2395 file_contents = APT_PIPE_TPL % (setting)
2396 util.write_file(f_name, file_contents)
2397 log.debug("Wrote %s with apt pipeline depth setting %s", f_name, setting)
2398+
2399+# vi: ts=4 expandtab
2400diff --git a/cloudinit/config/cc_bootcmd.py b/cloudinit/config/cc_bootcmd.py
2401index 22b23f2..604f93b 100644
2402--- a/cloudinit/config/cc_bootcmd.py
2403+++ b/cloudinit/config/cc_bootcmd.py
2404@@ -1,22 +1,10 @@
2405-# vi: ts=4 expandtab
2406-#
2407-# Copyright (C) 2009-2011 Canonical Ltd.
2408-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
2409-#
2410-# Author: Scott Moser <scott.moser@canonical.com>
2411-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2412+# Copyright (C) 2009-2011 Canonical Ltd.
2413+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
2414 #
2415-# This program is free software: you can redistribute it and/or modify
2416-# it under the terms of the GNU General Public License version 3, as
2417-# published by the Free Software Foundation.
2418+# Author: Scott Moser <scott.moser@canonical.com>
2419+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2420 #
2421-# This program is distributed in the hope that it will be useful,
2422-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2423-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2424-# GNU General Public License for more details.
2425-#
2426-# You should have received a copy of the GNU General Public License
2427-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2428+# This file is part of cloud-init. See LICENSE file for license information.
2429
2430 """
2431 Bootcmd
2432@@ -43,7 +31,7 @@ specified either as lists or strings. For invocation details, see ``runcmd``.
2433
2434 bootcmd:
2435 - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
2436- - [ cloud-nit-per, once, mymkfs, mkfs, /dev/vdb ]
2437+ - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
2438 """
2439
2440 import os
2441@@ -80,3 +68,5 @@ def handle(name, cfg, cloud, log, _args):
2442 except Exception:
2443 util.logexc(log, "Failed to run bootcmd module %s", name)
2444 raise
2445+
2446+# vi: ts=4 expandtab
2447diff --git a/cloudinit/config/cc_byobu.py b/cloudinit/config/cc_byobu.py
2448index 4a616e2..8570da1 100755
2449--- a/cloudinit/config/cc_byobu.py
2450+++ b/cloudinit/config/cc_byobu.py
2451@@ -1,22 +1,10 @@
2452-# vi: ts=4 expandtab
2453-#
2454-# Copyright (C) 2009-2010 Canonical Ltd.
2455-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2456-#
2457-# Author: Scott Moser <scott.moser@canonical.com>
2458-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2459+# Copyright (C) 2009-2010 Canonical Ltd.
2460+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2461 #
2462-# This program is free software: you can redistribute it and/or modify
2463-# it under the terms of the GNU General Public License version 3, as
2464-# published by the Free Software Foundation.
2465+# Author: Scott Moser <scott.moser@canonical.com>
2466+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2467 #
2468-# This program is distributed in the hope that it will be useful,
2469-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2470-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2471-# GNU General Public License for more details.
2472-#
2473-# You should have received a copy of the GNU General Public License
2474-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2475+# This file is part of cloud-init. See LICENSE file for license information.
2476
2477 """
2478 Byobu
2479@@ -106,3 +94,5 @@ def handle(name, cfg, cloud, log, args):
2480 cmd = ["/bin/sh", "-c", "%s %s %s" % ("X=0;", shcmd, "exit $X")]
2481 log.debug("Setting byobu to %s", value)
2482 util.subp(cmd, capture=False)
2483+
2484+# vi: ts=4 expandtab
2485diff --git a/cloudinit/config/cc_ca_certs.py b/cloudinit/config/cc_ca_certs.py
2486index 53d1406..64bc900 100644
2487--- a/cloudinit/config/cc_ca_certs.py
2488+++ b/cloudinit/config/cc_ca_certs.py
2489@@ -1,18 +1,6 @@
2490-# vi: ts=4 expandtab
2491-#
2492-# Author: Mike Milner <mike.milner@canonical.com>
2493-#
2494-# This program is free software: you can redistribute it and/or modify
2495-# it under the terms of the GNU General Public License version 3, as
2496-# published by the Free Software Foundation.
2497+# Author: Mike Milner <mike.milner@canonical.com>
2498 #
2499-# This program is distributed in the hope that it will be useful,
2500-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2501-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2502-# GNU General Public License for more details.
2503-#
2504-# You should have received a copy of the GNU General Public License
2505-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2506+# This file is part of cloud-init. See LICENSE file for license information.
2507
2508 """
2509 CA Certs
2510@@ -32,7 +20,7 @@ can be removed from the system with the configuration option
2511
2512 **Module frequency:** per instance
2513
2514-**Supporte distros:** ubuntu, debian
2515+**Supported distros:** ubuntu, debian
2516
2517 **Config keys**::
2518
2519@@ -82,8 +70,8 @@ def add_ca_certs(certs):
2520 # We have to strip the content because blank lines in the file
2521 # causes subsequent entries to be ignored. (LP: #1077020)
2522 orig = util.load_file(CA_CERT_CONFIG)
2523- cur_cont = '\n'.join([l for l in orig.splitlines()
2524- if l != CA_CERT_FILENAME])
2525+ cur_cont = '\n'.join([line for line in orig.splitlines()
2526+ if line != CA_CERT_FILENAME])
2527 out = "%s\n%s\n" % (cur_cont.rstrip(), CA_CERT_FILENAME)
2528 util.write_file(CA_CERT_CONFIG, out, omode="wb")
2529
2530@@ -134,3 +122,5 @@ def handle(name, cfg, _cloud, log, _args):
2531 # Update the system with the new cert configuration.
2532 log.debug("Updating certificates")
2533 update_ca_certs()
2534+
2535+# vi: ts=4 expandtab
2536diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
2537index 922fb6a..2be2532 100644
2538--- a/cloudinit/config/cc_chef.py
2539+++ b/cloudinit/config/cc_chef.py
2540@@ -1,22 +1,10 @@
2541-# vi: ts=4 expandtab
2542-#
2543-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2544-#
2545-# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
2546-# Author: Mike Moulton <mike@meltmedia.com>
2547-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2548+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2549 #
2550-# This program is free software: you can redistribute it and/or modify
2551-# it under the terms of the GNU General Public License version 3, as
2552-# published by the Free Software Foundation.
2553+# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
2554+# Author: Mike Moulton <mike@meltmedia.com>
2555+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2556 #
2557-# This program is distributed in the hope that it will be useful,
2558-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2559-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2560-# GNU General Public License for more details.
2561-#
2562-# You should have received a copy of the GNU General Public License
2563-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2564+# This file is part of cloud-init. See LICENSE file for license information.
2565
2566 """
2567 Chef
2568@@ -314,7 +302,7 @@ def install_chef(cloud, chef_cfg, log):
2569 retries = max(0, util.get_cfg_option_int(chef_cfg,
2570 "omnibus_url_retries",
2571 default=OMNIBUS_URL_RETRIES))
2572- content = url_helper.readurl(url=url, retries=retries)
2573+ content = url_helper.readurl(url=url, retries=retries).contents
2574 with util.tempdir() as tmpd:
2575 # Use tmpdir over tmpfile to avoid 'text file busy' on execute
2576 tmpf = "%s/chef-omnibus-install" % tmpd
2577@@ -348,3 +336,5 @@ def install_chef_from_gems(ruby_version, chef_version, distro):
2578 util.subp(['/usr/bin/gem', 'install', 'chef',
2579 '--no-ri', '--no-rdoc', '--bindir',
2580 '/usr/bin', '-q'], capture=False)
2581+
2582+# vi: ts=4 expandtab
2583diff --git a/cloudinit/config/cc_debug.py b/cloudinit/config/cc_debug.py
2584index 5ab3646..0a039eb 100644
2585--- a/cloudinit/config/cc_debug.py
2586+++ b/cloudinit/config/cc_debug.py
2587@@ -1,18 +1,6 @@
2588-# vi: ts=4 expandtab
2589-#
2590-# Copyright (C) 2013 Yahoo! Inc.
2591-#
2592-# This program is free software: you can redistribute it and/or modify
2593-# it under the terms of the GNU General Public License version 3, as
2594-# published by the Free Software Foundation.
2595+# Copyright (C) 2013 Yahoo! Inc.
2596 #
2597-# This program is distributed in the hope that it will be useful,
2598-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2599-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2600-# GNU General Public License for more details.
2601-#
2602-# You should have received a copy of the GNU General Public License
2603-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2604+# This file is part of cloud-init. See LICENSE file for license information.
2605
2606 """
2607 Debug
2608@@ -113,3 +101,5 @@ def handle(name, cfg, cloud, log, args):
2609 util.write_file(out_file, "".join(content_to_file), 0o644, "w")
2610 else:
2611 util.multi_log("".join(content_to_file), console=True, stderr=False)
2612+
2613+# vi: ts=4 expandtab
2614diff --git a/cloudinit/config/cc_disable_ec2_metadata.py b/cloudinit/config/cc_disable_ec2_metadata.py
2615index 5c54e6f..c56319b 100644
2616--- a/cloudinit/config/cc_disable_ec2_metadata.py
2617+++ b/cloudinit/config/cc_disable_ec2_metadata.py
2618@@ -1,22 +1,10 @@
2619-# vi: ts=4 expandtab
2620-#
2621-# Copyright (C) 2009-2010 Canonical Ltd.
2622-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2623-#
2624-# Author: Scott Moser <scott.moser@canonical.com>
2625-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2626+# Copyright (C) 2009-2010 Canonical Ltd.
2627+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2628 #
2629-# This program is free software: you can redistribute it and/or modify
2630-# it under the terms of the GNU General Public License version 3, as
2631-# published by the Free Software Foundation.
2632+# Author: Scott Moser <scott.moser@canonical.com>
2633+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2634 #
2635-# This program is distributed in the hope that it will be useful,
2636-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2637-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2638-# GNU General Public License for more details.
2639-#
2640-# You should have received a copy of the GNU General Public License
2641-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2642+# This file is part of cloud-init. See LICENSE file for license information.
2643
2644 """
2645 Disable EC2 Metadata
2646@@ -54,3 +42,5 @@ def handle(name, cfg, _cloud, log, _args):
2647 else:
2648 log.debug(("Skipping module named %s,"
2649 " disabling the ec2 route not enabled"), name)
2650+
2651+# vi: ts=4 expandtab
2652diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
2653index 0c4b794..f39f081 100644
2654--- a/cloudinit/config/cc_disk_setup.py
2655+++ b/cloudinit/config/cc_disk_setup.py
2656@@ -1,21 +1,9 @@
2657-# vi: ts=4 expandtab
2658-#
2659-# Copyright (C) 2009-2010 Canonical Ltd.
2660-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2661-#
2662-# Author: Ben Howard <ben.howard@canonical.com>
2663-#
2664-# This program is free software: you can redistribute it and/or modify
2665-# it under the terms of the GNU General Public License version 3, as
2666-# published by the Free Software Foundation.
2667+# Copyright (C) 2009-2010 Canonical Ltd.
2668+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2669 #
2670-# This program is distributed in the hope that it will be useful,
2671-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2672-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2673-# GNU General Public License for more details.
2674+# Author: Ben Howard <ben.howard@canonical.com>
2675 #
2676-# You should have received a copy of the GNU General Public License
2677-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2678+# This file is part of cloud-init. See LICENSE file for license information.
2679
2680 """
2681 Disk Setup
2682@@ -213,7 +201,7 @@ def update_fs_setup_devices(disk_setup, tformer):
2683
2684 if part and 'partition' in definition:
2685 definition['_partition'] = definition['partition']
2686- definition['partition'] = part
2687+ definition['partition'] = part
2688
2689
2690 def value_splitter(values, start=None):
2691@@ -436,14 +424,13 @@ def get_dyn_func(*args):
2692
2693
2694 def get_mbr_hdd_size(device):
2695- size_cmd = [SFDISK_CMD, '--show-size', device]
2696- size = None
2697 try:
2698- size, _err = util.subp(size_cmd)
2699+ size_in_bytes, _ = util.subp([BLKDEV_CMD, '--getsize64', device])
2700+ sector_size, _ = util.subp([BLKDEV_CMD, '--getss', device])
2701 except Exception as e:
2702 raise Exception("Failed to get %s size\n%s" % (device, e))
2703
2704- return int(size.strip())
2705+ return int(size_in_bytes) / int(sector_size)
2706
2707
2708 def get_gpt_hdd_size(device):
2709@@ -588,7 +575,7 @@ def get_partition_mbr_layout(size, layout):
2710 raise Exception("Partition was incorrectly defined: %s" % part)
2711 percent, part_type = part
2712
2713- part_size = int((float(size) * (float(percent) / 100)) / 1024)
2714+ part_size = int(float(size) * (float(percent) / 100))
2715
2716 if part_num == last_part_num:
2717 part_definition.append(",,%s" % part_type)
2718@@ -692,7 +679,7 @@ def exec_mkpart_mbr(device, layout):
2719 types, i.e. gpt
2720 """
2721 # Create the partitions
2722- prt_cmd = [SFDISK_CMD, "--Linux", "-uM", device]
2723+ prt_cmd = [SFDISK_CMD, "--Linux", "--unit=S", "--force", device]
2724 try:
2725 util.subp(prt_cmd, data="%s\n" % layout)
2726 except Exception as e:
2727@@ -909,7 +896,8 @@ def mkfs(fs_cfg):
2728 LOG.debug("Error in device identification handling.")
2729 return
2730
2731- LOG.debug("File system %s will be created on %s", label, device)
2732+ LOG.debug("File system type '%s' with label '%s' will be created on %s",
2733+ fs_type, label, device)
2734
2735 # Make sure the device is defined
2736 if not device:
2737@@ -958,3 +946,5 @@ def mkfs(fs_cfg):
2738 util.subp(fs_cmd)
2739 except Exception as e:
2740 raise Exception("Failed to exec of '%s':\n%s" % (fs_cmd, e))
2741+
2742+# vi: ts=4 expandtab
2743diff --git a/cloudinit/config/cc_emit_upstart.py b/cloudinit/config/cc_emit_upstart.py
2744index a7be635..69dc2d5 100644
2745--- a/cloudinit/config/cc_emit_upstart.py
2746+++ b/cloudinit/config/cc_emit_upstart.py
2747@@ -1,22 +1,10 @@
2748-# vi: ts=4 expandtab
2749-#
2750-# Copyright (C) 2009-2011 Canonical Ltd.
2751-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2752-#
2753-# Author: Scott Moser <scott.moser@canonical.com>
2754-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2755+# Copyright (C) 2009-2011 Canonical Ltd.
2756+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2757 #
2758-# This program is free software: you can redistribute it and/or modify
2759-# it under the terms of the GNU General Public License version 3, as
2760-# published by the Free Software Foundation.
2761+# Author: Scott Moser <scott.moser@canonical.com>
2762+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2763 #
2764-# This program is distributed in the hope that it will be useful,
2765-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2766-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2767-# GNU General Public License for more details.
2768-#
2769-# You should have received a copy of the GNU General Public License
2770-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2771+# This file is part of cloud-init. See LICENSE file for license information.
2772
2773 """
2774 Emit Upstart
2775@@ -82,3 +70,5 @@ def handle(name, _cfg, cloud, log, args):
2776 except Exception as e:
2777 # TODO(harlowja), use log exception from utils??
2778 log.warn("Emission of upstart event %s failed due to: %s", n, e)
2779+
2780+# vi: ts=4 expandtab
2781diff --git a/cloudinit/config/cc_fan.py b/cloudinit/config/cc_fan.py
2782index 6027fdc..f0cda3d 100644
2783--- a/cloudinit/config/cc_fan.py
2784+++ b/cloudinit/config/cc_fan.py
2785@@ -1,20 +1,8 @@
2786-# vi: ts=4 expandtab
2787-#
2788-# Copyright (C) 2015 Canonical Ltd.
2789-#
2790-# Author: Scott Moser <scott.moser@canonical.com>
2791+# Copyright (C) 2015 Canonical Ltd.
2792 #
2793-# This program is free software: you can redistribute it and/or modify
2794-# it under the terms of the GNU General Public License version 3, as
2795-# published by the Free Software Foundation.
2796+# Author: Scott Moser <scott.moser@canonical.com>
2797 #
2798-# This program is distributed in the hope that it will be useful,
2799-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2800-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2801-# GNU General Public License for more details.
2802-#
2803-# You should have received a copy of the GNU General Public License
2804-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2805+# This file is part of cloud-init. See LICENSE file for license information.
2806
2807 """
2808 Fan
2809@@ -112,3 +100,5 @@ def handle(name, cfg, cloud, log, args):
2810 stop_update_start(
2811 service='ubuntu-fan', config_file=mycfg.get('config_path'),
2812 content=mycfg.get('config'), systemd=distro.uses_systemd())
2813+
2814+# vi: ts=4 expandtab
2815diff --git a/cloudinit/config/cc_final_message.py b/cloudinit/config/cc_final_message.py
2816index 5e144fd..c61f03d 100644
2817--- a/cloudinit/config/cc_final_message.py
2818+++ b/cloudinit/config/cc_final_message.py
2819@@ -1,22 +1,10 @@
2820-# vi: ts=4 expandtab
2821-#
2822-# Copyright (C) 2011 Canonical Ltd.
2823-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2824-#
2825-# Author: Scott Moser <scott.moser@canonical.com>
2826-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2827+# Copyright (C) 2011 Canonical Ltd.
2828+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2829 #
2830-# This program is free software: you can redistribute it and/or modify
2831-# it under the terms of the GNU General Public License version 3, as
2832-# published by the Free Software Foundation.
2833+# Author: Scott Moser <scott.moser@canonical.com>
2834+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2835 #
2836-# This program is distributed in the hope that it will be useful,
2837-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2838-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2839-# GNU General Public License for more details.
2840-#
2841-# You should have received a copy of the GNU General Public License
2842-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2843+# This file is part of cloud-init. See LICENSE file for license information.
2844
2845 """
2846 Final Message
2847@@ -96,3 +84,5 @@ def handle(_name, cfg, cloud, log, args):
2848
2849 if cloud.datasource.is_disconnected:
2850 log.warn("Used fallback datasource")
2851+
2852+# vi: ts=4 expandtab
2853diff --git a/cloudinit/config/cc_foo.py b/cloudinit/config/cc_foo.py
2854index ad0e046..924b967 100644
2855--- a/cloudinit/config/cc_foo.py
2856+++ b/cloudinit/config/cc_foo.py
2857@@ -1,22 +1,10 @@
2858-# vi: ts=4 expandtab
2859-#
2860-# Copyright (C) 2009-2010 Canonical Ltd.
2861-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2862-#
2863-# Author: Scott Moser <scott.moser@canonical.com>
2864-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2865+# Copyright (C) 2009-2010 Canonical Ltd.
2866+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2867 #
2868-# This program is free software: you can redistribute it and/or modify
2869-# it under the terms of the GNU General Public License version 3, as
2870-# published by the Free Software Foundation.
2871+# Author: Scott Moser <scott.moser@canonical.com>
2872+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2873 #
2874-# This program is distributed in the hope that it will be useful,
2875-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2876-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2877-# GNU General Public License for more details.
2878-#
2879-# You should have received a copy of the GNU General Public License
2880-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2881+# This file is part of cloud-init. See LICENSE file for license information.
2882
2883 """
2884 Foo
2885@@ -64,3 +52,5 @@ frequency = PER_INSTANCE
2886
2887 def handle(name, _cfg, _cloud, log, _args):
2888 log.debug("Hi from module %s", name)
2889+
2890+# vi: ts=4 expandtab
2891diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
2892index a95e6c8..832bb3f 100644
2893--- a/cloudinit/config/cc_growpart.py
2894+++ b/cloudinit/config/cc_growpart.py
2895@@ -1,22 +1,10 @@
2896-# vi: ts=4 expandtab
2897-#
2898-# Copyright (C) 2011 Canonical Ltd.
2899-# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
2900-#
2901-# Author: Scott Moser <scott.moser@canonical.com>
2902-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2903-#
2904-# This program is free software: you can redistribute it and/or modify
2905-# it under the terms of the GNU General Public License version 3, as
2906-# published by the Free Software Foundation.
2907+# Copyright (C) 2011 Canonical Ltd.
2908+# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
2909 #
2910-# This program is distributed in the hope that it will be useful,
2911-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2912-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2913-# GNU General Public License for more details.
2914+# Author: Scott Moser <scott.moser@canonical.com>
2915+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2916 #
2917-# You should have received a copy of the GNU General Public License
2918-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2919+# This file is part of cloud-init. See LICENSE file for license information.
2920
2921 """
2922 Growpart
2923@@ -354,4 +342,7 @@ def handle(_name, cfg, _cloud, log, _args):
2924 else:
2925 log.debug("'%s' %s: %s" % (entry, action, msg))
2926
2927+
2928 RESIZERS = (('growpart', ResizeGrowPart), ('gpart', ResizeGpart))
2929+
2930+# vi: ts=4 expandtab
2931diff --git a/cloudinit/config/cc_grub_dpkg.py b/cloudinit/config/cc_grub_dpkg.py
2932index 33ca40a..a323edf 100644
2933--- a/cloudinit/config/cc_grub_dpkg.py
2934+++ b/cloudinit/config/cc_grub_dpkg.py
2935@@ -1,22 +1,10 @@
2936-# vi: ts=4 expandtab
2937-#
2938-# Copyright (C) 2009-2010 Canonical Ltd.
2939-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2940-#
2941-# Author: Scott Moser <scott.moser@canonical.com>
2942-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2943+# Copyright (C) 2009-2010 Canonical Ltd.
2944+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2945 #
2946-# This program is free software: you can redistribute it and/or modify
2947-# it under the terms of the GNU General Public License version 3, as
2948-# published by the Free Software Foundation.
2949+# Author: Scott Moser <scott.moser@canonical.com>
2950+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2951 #
2952-# This program is distributed in the hope that it will be useful,
2953-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2954-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2955-# GNU General Public License for more details.
2956-#
2957-# You should have received a copy of the GNU General Public License
2958-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2959+# This file is part of cloud-init. See LICENSE file for license information.
2960
2961 """
2962 Grub Dpkg
2963@@ -105,3 +93,5 @@ def handle(name, cfg, _cloud, log, _args):
2964 util.subp(['debconf-set-selections'], dconf_sel)
2965 except Exception:
2966 util.logexc(log, "Failed to run debconf-set-selections for grub-dpkg")
2967+
2968+# vi: ts=4 expandtab
2969diff --git a/cloudinit/config/cc_keys_to_console.py b/cloudinit/config/cc_keys_to_console.py
2970index d4b2013..efedd4a 100644
2971--- a/cloudinit/config/cc_keys_to_console.py
2972+++ b/cloudinit/config/cc_keys_to_console.py
2973@@ -1,22 +1,10 @@
2974-# vi: ts=4 expandtab
2975-#
2976-# Copyright (C) 2011 Canonical Ltd.
2977-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2978-#
2979-# Author: Scott Moser <scott.moser@canonical.com>
2980-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2981+# Copyright (C) 2011 Canonical Ltd.
2982+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2983 #
2984-# This program is free software: you can redistribute it and/or modify
2985-# it under the terms of the GNU General Public License version 3, as
2986-# published by the Free Software Foundation.
2987+# Author: Scott Moser <scott.moser@canonical.com>
2988+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
2989 #
2990-# This program is distributed in the hope that it will be useful,
2991-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2992-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2993-# GNU General Public License for more details.
2994-#
2995-# You should have received a copy of the GNU General Public License
2996-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2997+# This file is part of cloud-init. See LICENSE file for license information.
2998
2999 """
3000 Keys to Console
3001@@ -84,3 +72,5 @@ def handle(name, cfg, cloud, log, _args):
3002 except Exception:
3003 log.warn("Writing keys to the system console failed!")
3004 raise
3005+
3006+# vi: ts=4 expandtab
3007diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
3008index 11c8451..86b7138 100644
3009--- a/cloudinit/config/cc_landscape.py
3010+++ b/cloudinit/config/cc_landscape.py
3011@@ -1,22 +1,10 @@
3012-# vi: ts=4 expandtab
3013-#
3014-# Copyright (C) 2011 Canonical Ltd.
3015-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3016-#
3017-# Author: Scott Moser <scott.moser@canonical.com>
3018-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3019+# Copyright (C) 2011 Canonical Ltd.
3020+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3021 #
3022-# This program is free software: you can redistribute it and/or modify
3023-# it under the terms of the GNU General Public License version 3, as
3024-# published by the Free Software Foundation.
3025+# Author: Scott Moser <scott.moser@canonical.com>
3026+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3027 #
3028-# This program is distributed in the hope that it will be useful,
3029-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3030-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3031-# GNU General Public License for more details.
3032-#
3033-# You should have received a copy of the GNU General Public License
3034-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3035+# This file is part of cloud-init. See LICENSE file for license information.
3036
3037 """
3038 Landscape
3039@@ -146,3 +134,5 @@ def merge_together(objs):
3040 else:
3041 cfg.merge(ConfigObj(obj))
3042 return cfg
3043+
3044+# vi: ts=4 expandtab
3045diff --git a/cloudinit/config/cc_locale.py b/cloudinit/config/cc_locale.py
3046index 268888e..f68c3cc 100644
3047--- a/cloudinit/config/cc_locale.py
3048+++ b/cloudinit/config/cc_locale.py
3049@@ -1,22 +1,10 @@
3050-# vi: ts=4 expandtab
3051-#
3052-# Copyright (C) 2011 Canonical Ltd.
3053-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3054-#
3055-# Author: Scott Moser <scott.moser@canonical.com>
3056-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3057+# Copyright (C) 2011 Canonical Ltd.
3058+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3059 #
3060-# This program is free software: you can redistribute it and/or modify
3061-# it under the terms of the GNU General Public License version 3, as
3062-# published by the Free Software Foundation.
3063+# Author: Scott Moser <scott.moser@canonical.com>
3064+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3065 #
3066-# This program is distributed in the hope that it will be useful,
3067-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3068-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3069-# GNU General Public License for more details.
3070-#
3071-# You should have received a copy of the GNU General Public License
3072-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3073+# This file is part of cloud-init. See LICENSE file for license information.
3074
3075 """
3076 Locale
3077@@ -55,3 +43,5 @@ def handle(name, cfg, cloud, log, args):
3078 log.debug("Setting locale to %s", locale)
3079 locale_cfgfile = util.get_cfg_option_str(cfg, "locale_configfile")
3080 cloud.distro.apply_locale(locale, locale_cfgfile)
3081+
3082+# vi: ts=4 expandtab
3083diff --git a/cloudinit/config/cc_lxd.py b/cloudinit/config/cc_lxd.py
3084index 3e7faca..e6262f8 100644
3085--- a/cloudinit/config/cc_lxd.py
3086+++ b/cloudinit/config/cc_lxd.py
3087@@ -1,20 +1,8 @@
3088-# vi: ts=4 expandtab
3089-#
3090-# Copyright (C) 2016 Canonical Ltd.
3091-#
3092-# Author: Wesley Wiedenmeier <wesley.wiedenmeier@canonical.com>
3093+# Copyright (C) 2016 Canonical Ltd.
3094 #
3095-# This program is free software: you can redistribute it and/or modify
3096-# it under the terms of the GNU General Public License version 3, as
3097-# published by the Free Software Foundation.
3098+# Author: Wesley Wiedenmeier <wesley.wiedenmeier@canonical.com>
3099 #
3100-# This program is distributed in the hope that it will be useful,
3101-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3102-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3103-# GNU General Public License for more details.
3104-#
3105-# You should have received a copy of the GNU General Public License
3106-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3107+# This file is part of cloud-init. See LICENSE file for license information.
3108
3109 """
3110 LXD
3111@@ -262,3 +250,5 @@ def bridge_to_cmd(bridge_cfg):
3112 cmd_create.append("--force-local")
3113
3114 return cmd_create, cmd_attach
3115+
3116+# vi: ts=4 expandtab
3117diff --git a/cloudinit/config/cc_mcollective.py b/cloudinit/config/cc_mcollective.py
3118index c447f26..d5f63f5 100644
3119--- a/cloudinit/config/cc_mcollective.py
3120+++ b/cloudinit/config/cc_mcollective.py
3121@@ -1,23 +1,11 @@
3122-# vi: ts=4 expandtab
3123-#
3124-# Copyright (C) 2009-2011 Canonical Ltd.
3125-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3126-#
3127-# Author: Marc Cluet <marc.cluet@canonical.com>
3128-# Based on code by Scott Moser <scott.moser@canonical.com>
3129-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3130+# Copyright (C) 2009-2011 Canonical Ltd.
3131+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3132 #
3133-# This program is free software: you can redistribute it and/or modify
3134-# it under the terms of the GNU General Public License version 3, as
3135-# published by the Free Software Foundation.
3136+# Author: Marc Cluet <marc.cluet@canonical.com>
3137+# Based on code by Scott Moser <scott.moser@canonical.com>
3138+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3139 #
3140-# This program is distributed in the hope that it will be useful,
3141-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3142-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3143-# GNU General Public License for more details.
3144-#
3145-# You should have received a copy of the GNU General Public License
3146-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3147+# This file is part of cloud-init. See LICENSE file for license information.
3148
3149 """
3150 Mcollective
3151@@ -155,3 +143,5 @@ def handle(name, cfg, cloud, log, _args):
3152
3153 # restart mcollective to handle updated config
3154 util.subp(['service', 'mcollective', 'restart'], capture=False)
3155+
3156+# vi: ts=4 expandtab
3157diff --git a/cloudinit/config/cc_migrator.py b/cloudinit/config/cc_migrator.py
3158index 6e0bf4b..3995704 100644
3159--- a/cloudinit/config/cc_migrator.py
3160+++ b/cloudinit/config/cc_migrator.py
3161@@ -1,20 +1,8 @@
3162-# vi: ts=4 expandtab
3163-#
3164-# Copyright (C) 2012 Yahoo! Inc.
3165-#
3166-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
3167+# Copyright (C) 2012 Yahoo! Inc.
3168 #
3169-# This program is free software: you can redistribute it and/or modify
3170-# it under the terms of the GNU General Public License version 3, as
3171-# published by the Free Software Foundation.
3172+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
3173 #
3174-# This program is distributed in the hope that it will be useful,
3175-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3176-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3177-# GNU General Public License for more details.
3178-#
3179-# You should have received a copy of the GNU General Public License
3180-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3181+# This file is part of cloud-init. See LICENSE file for license information.
3182
3183 """
3184 Migrator
3185@@ -105,3 +93,5 @@ def handle(name, cfg, cloud, log, _args):
3186 log.debug("Migrated %s semaphore files to there canonicalized names",
3187 sems_moved)
3188 _migrate_legacy_sems(cloud, log)
3189+
3190+# vi: ts=4 expandtab
3191diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
3192index dfc4b59..5b630f8 100644
3193--- a/cloudinit/config/cc_mounts.py
3194+++ b/cloudinit/config/cc_mounts.py
3195@@ -1,22 +1,10 @@
3196-# vi: ts=4 expandtab
3197-#
3198-# Copyright (C) 2009-2010 Canonical Ltd.
3199-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3200-#
3201-# Author: Scott Moser <scott.moser@canonical.com>
3202-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3203-#
3204-# This program is free software: you can redistribute it and/or modify
3205-# it under the terms of the GNU General Public License version 3, as
3206-# published by the Free Software Foundation.
3207+# Copyright (C) 2009-2010 Canonical Ltd.
3208+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3209 #
3210-# This program is distributed in the hope that it will be useful,
3211-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3212-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3213-# GNU General Public License for more details.
3214+# Author: Scott Moser <scott.moser@canonical.com>
3215+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3216 #
3217-# You should have received a copy of the GNU General Public License
3218-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3219+# This file is part of cloud-init. See LICENSE file for license information.
3220
3221 """
3222 Mounts
3223@@ -42,6 +30,14 @@ values. It defaults to::
3224
3225 mount_default_fields: [none, none, "auto", "defaults,nobootwait", "0", "2"]
3226
3227+On a systemd booted system that default is the mostly equivalent::
3228+
3229+ mount_default_fields: [none, none, "auto",
3230+ "defaults,nofail,x-systemd.requires=cloud-init.service", "0", "2"]
3231+
3232+Note that `nobootwait` is an upstart specific boot option that somewhat
3233+equates to the more standard `nofail`.
3234+
3235 Swap files can be configured by setting the path to the swap file to create
3236 with ``filename``, the size of the swap file with ``size`` maximum size of
3237 the swap file if using an ``size: auto`` with ``maxsize``. By default no
3238@@ -58,8 +54,8 @@ swap file is created.
3239 mounts:
3240 - [ /dev/ephemeral0, /mnt, auto, "defaults,noexec" ]
3241 - [ sdc, /opt/data ]
3242- - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ]
3243- mount_default_fields: [None, None, "auto", "nefaults,nobootwait", "0", "2"]
3244+ - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ]
3245+ mount_default_fields: [None, None, "auto", "defaults,nofail", "0", "2"]
3246 swap:
3247 filename: <file>
3248 size: <"auto"/size in bytes>
3249@@ -312,7 +308,8 @@ def handle_swapcfg(swapcfg):
3250 def handle(_name, cfg, cloud, log, _args):
3251 # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno
3252 def_mnt_opts = "defaults,nobootwait"
3253- if cloud.distro.uses_systemd():
3254+ uses_systemd = cloud.distro.uses_systemd()
3255+ if uses_systemd:
3256 def_mnt_opts = "defaults,nofail,x-systemd.requires=cloud-init.service"
3257
3258 defvals = [None, None, "auto", def_mnt_opts, "0", "2"]
3259@@ -326,6 +323,8 @@ def handle(_name, cfg, cloud, log, _args):
3260 if "mounts" in cfg:
3261 cfgmnt = cfg["mounts"]
3262
3263+ LOG.debug("mounts configuration is %s", cfgmnt)
3264+
3265 for i in range(len(cfgmnt)):
3266 # skip something that wasn't a list
3267 if not isinstance(cfgmnt[i], list):
3268@@ -422,32 +421,53 @@ def handle(_name, cfg, cloud, log, _args):
3269 cc_lines.append('\t'.join(line))
3270
3271 fstab_lines = []
3272+ removed = []
3273 for line in util.load_file(FSTAB_PATH).splitlines():
3274 try:
3275 toks = WS.split(line)
3276 if toks[3].find(comment) != -1:
3277+ removed.append(line)
3278 continue
3279 except Exception:
3280 pass
3281 fstab_lines.append(line)
3282
3283+ for d in dirs:
3284+ try:
3285+ util.ensure_dir(d)
3286+ except Exception:
3287+ util.logexc(log, "Failed to make '%s' config-mount", d)
3288+
3289+ sadds = [WS.sub(" ", n) for n in cc_lines]
3290+ sdrops = [WS.sub(" ", n) for n in removed]
3291+
3292+ sops = (["- " + drop for drop in sdrops if drop not in sadds] +
3293+ ["+ " + add for add in sadds if add not in sdrops])
3294+
3295 fstab_lines.extend(cc_lines)
3296 contents = "%s\n" % ('\n'.join(fstab_lines))
3297 util.write_file(FSTAB_PATH, contents)
3298
3299+ activate_cmds = []
3300 if needswap:
3301- try:
3302- util.subp(("swapon", "-a"))
3303- except Exception:
3304- util.logexc(log, "Activating swap via 'swapon -a' failed")
3305+ activate_cmds.append(["swapon", "-a"])
3306
3307- for d in dirs:
3308+ if len(sops) == 0:
3309+ log.debug("No changes to /etc/fstab made.")
3310+ else:
3311+ log.debug("Changes to fstab: %s", sops)
3312+ activate_cmds.append(["mount", "-a"])
3313+ if uses_systemd:
3314+ activate_cmds.append(["systemctl", "daemon-reload"])
3315+
3316+ fmt = "Activating swap and mounts with: %s"
3317+ for cmd in activate_cmds:
3318+ fmt = "Activate mounts: %s:" + ' '.join(cmd)
3319 try:
3320- util.ensure_dir(d)
3321- except Exception:
3322- util.logexc(log, "Failed to make '%s' config-mount", d)
3323+ util.subp(cmd)
3324+ log.debug(fmt, "PASS")
3325+ except util.ProcessExecutionError:
3326+ log.warn(fmt, "FAIL")
3327+ util.logexc(log, fmt, "FAIL")
3328
3329- try:
3330- util.subp(("mount", "-a"))
3331- except util.ProcessExecutionError:
3332- util.logexc(log, "Activating mounts via 'mount -a' failed")
3333+# vi: ts=4 expandtab
3334diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
3335index 7cda317..e33032f 100644
3336--- a/cloudinit/config/cc_ntp.py
3337+++ b/cloudinit/config/cc_ntp.py
3338@@ -1,20 +1,8 @@
3339-# vi: ts=4 expandtab
3340-#
3341-# Copyright (C) 2016 Canonical Ltd.
3342-#
3343-# Author: Ryan Harper <ryan.harper@canonical.com>
3344+# Copyright (C) 2016 Canonical Ltd.
3345 #
3346-# This program is free software: you can redistribute it and/or modify
3347-# it under the terms of the GNU General Public License version 3, as
3348-# published by the Free Software Foundation.
3349+# Author: Ryan Harper <ryan.harper@canonical.com>
3350 #
3351-# This program is distributed in the hope that it will be useful,
3352-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3353-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3354-# GNU General Public License for more details.
3355-#
3356-# You should have received a copy of the GNU General Public License
3357-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3358+# This file is part of cloud-init. See LICENSE file for license information.
3359
3360 """
3361 NTP
3362@@ -136,3 +124,5 @@ def write_ntp_config_template(cfg, cloud):
3363 "not rendering %s"), NTP_CONF)
3364
3365 templater.render_to_file(template_fn, NTP_CONF, params)
3366+
3367+# vi: ts=4 expandtab
3368diff --git a/cloudinit/config/cc_package_update_upgrade_install.py b/cloudinit/config/cc_package_update_upgrade_install.py
3369index 6d71761..17b9101 100644
3370--- a/cloudinit/config/cc_package_update_upgrade_install.py
3371+++ b/cloudinit/config/cc_package_update_upgrade_install.py
3372@@ -1,20 +1,8 @@
3373-# vi: ts=4 expandtab
3374-#
3375-# Copyright (C) 2012 Yahoo! Inc.
3376-#
3377-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
3378+# Copyright (C) 2012 Yahoo! Inc.
3379 #
3380-# This program is free software: you can redistribute it and/or modify
3381-# it under the terms of the GNU General Public License version 3, as
3382-# published by the Free Software Foundation.
3383+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
3384 #
3385-# This program is distributed in the hope that it will be useful,
3386-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3387-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3388-# GNU General Public License for more details.
3389-#
3390-# You should have received a copy of the GNU General Public License
3391-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3392+# This file is part of cloud-init. See LICENSE file for license information.
3393
3394 """
3395 Package Update Upgrade Install
3396@@ -132,3 +120,5 @@ def handle(_name, cfg, cloud, log, _args):
3397 log.warn("%s failed with exceptions, re-raising the last one",
3398 len(errors))
3399 raise errors[-1]
3400+
3401+# vi: ts=4 expandtab
3402diff --git a/cloudinit/config/cc_phone_home.py b/cloudinit/config/cc_phone_home.py
3403index cb70d39..878069b 100644
3404--- a/cloudinit/config/cc_phone_home.py
3405+++ b/cloudinit/config/cc_phone_home.py
3406@@ -1,22 +1,10 @@
3407-# vi: ts=4 expandtab
3408-#
3409-# Copyright (C) 2011 Canonical Ltd.
3410-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3411-#
3412-# Author: Scott Moser <scott.moser@canonical.com>
3413-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3414+# Copyright (C) 2011 Canonical Ltd.
3415+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3416 #
3417-# This program is free software: you can redistribute it and/or modify
3418-# it under the terms of the GNU General Public License version 3, as
3419-# published by the Free Software Foundation.
3420+# Author: Scott Moser <scott.moser@canonical.com>
3421+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3422 #
3423-# This program is distributed in the hope that it will be useful,
3424-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3425-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3426-# GNU General Public License for more details.
3427-#
3428-# You should have received a copy of the GNU General Public License
3429-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3430+# This file is part of cloud-init. See LICENSE file for license information.
3431
3432 """
3433 Phone Home
3434@@ -154,3 +142,5 @@ def handle(name, cfg, cloud, log, args):
3435 except Exception:
3436 util.logexc(log, "Failed to post phone home data to %s in %s tries",
3437 url, tries)
3438+
3439+# vi: ts=4 expandtab
3440diff --git a/cloudinit/config/cc_power_state_change.py b/cloudinit/config/cc_power_state_change.py
3441index 61b5416..c1c6fe7 100644
3442--- a/cloudinit/config/cc_power_state_change.py
3443+++ b/cloudinit/config/cc_power_state_change.py
3444@@ -1,20 +1,8 @@
3445-# vi: ts=4 expandtab
3446-#
3447-# Copyright (C) 2011 Canonical Ltd.
3448-#
3449-# Author: Scott Moser <scott.moser@canonical.com>
3450+# Copyright (C) 2011 Canonical Ltd.
3451 #
3452-# This program is free software: you can redistribute it and/or modify
3453-# it under the terms of the GNU General Public License version 3, as
3454-# published by the Free Software Foundation.
3455+# Author: Scott Moser <scott.moser@canonical.com>
3456 #
3457-# This program is distributed in the hope that it will be useful,
3458-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3459-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3460-# GNU General Public License for more details.
3461-#
3462-# You should have received a copy of the GNU General Public License
3463-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3464+# This file is part of cloud-init. See LICENSE file for license information.
3465
3466 """
3467 Power State Change
3468@@ -266,3 +254,5 @@ def run_after_pid_gone(pid, pidcmdline, timeout, log, condition, func, args):
3469 fatal("Unexpected Exception when checking condition: %s" % e)
3470
3471 func(*args)
3472+
3473+# vi: ts=4 expandtab
3474diff --git a/cloudinit/config/cc_puppet.py b/cloudinit/config/cc_puppet.py
3475index bfd630d..dc11561 100644
3476--- a/cloudinit/config/cc_puppet.py
3477+++ b/cloudinit/config/cc_puppet.py
3478@@ -1,22 +1,10 @@
3479-# vi: ts=4 expandtab
3480-#
3481-# Copyright (C) 2009-2010 Canonical Ltd.
3482-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3483-#
3484-# Author: Scott Moser <scott.moser@canonical.com>
3485-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3486+# Copyright (C) 2009-2010 Canonical Ltd.
3487+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3488 #
3489-# This program is free software: you can redistribute it and/or modify
3490-# it under the terms of the GNU General Public License version 3, as
3491-# published by the Free Software Foundation.
3492+# Author: Scott Moser <scott.moser@canonical.com>
3493+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3494 #
3495-# This program is distributed in the hope that it will be useful,
3496-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3497-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3498-# GNU General Public License for more details.
3499-#
3500-# You should have received a copy of the GNU General Public License
3501-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3502+# This file is part of cloud-init. See LICENSE file for license information.
3503
3504 """
3505 Puppet
3506@@ -161,3 +149,5 @@ def handle(name, cfg, cloud, log, _args):
3507
3508 # Start puppetd
3509 util.subp(['service', 'puppet', 'start'], capture=False)
3510+
3511+# vi: ts=4 expandtab
3512diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
3513index 1b91796..e028abf 100644
3514--- a/cloudinit/config/cc_resizefs.py
3515+++ b/cloudinit/config/cc_resizefs.py
3516@@ -1,22 +1,10 @@
3517-# vi: ts=4 expandtab
3518-#
3519-# Copyright (C) 2011 Canonical Ltd.
3520-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3521-#
3522-# Author: Scott Moser <scott.moser@canonical.com>
3523-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3524-#
3525-# This program is free software: you can redistribute it and/or modify
3526-# it under the terms of the GNU General Public License version 3, as
3527-# published by the Free Software Foundation.
3528+# Copyright (C) 2011 Canonical Ltd.
3529+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3530 #
3531-# This program is distributed in the hope that it will be useful,
3532-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3533-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3534-# GNU General Public License for more details.
3535+# Author: Scott Moser <scott.moser@canonical.com>
3536+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3537 #
3538-# You should have received a copy of the GNU General Public License
3539-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3540+# This file is part of cloud-init. See LICENSE file for license information.
3541
3542 """
3543 Resizefs
3544@@ -69,6 +57,7 @@ def _resize_xfs(mount_point, devpth):
3545 def _resize_ufs(mount_point, devpth):
3546 return ('growfs', devpth)
3547
3548+
3549 # Do not use a dictionary as these commands should be able to be used
3550 # for multiple filesystem types if possible, e.g. one command for
3551 # ext2, ext3 and ext4.
3552@@ -209,3 +198,5 @@ def do_resize(resize_cmd, log):
3553 raise
3554 # TODO(harlowja): Should we add a fsck check after this to make
3555 # sure we didn't corrupt anything?
3556+
3557+# vi: ts=4 expandtab
3558diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py
3559index feea565..9c5cd1f 100644
3560--- a/cloudinit/config/cc_resolv_conf.py
3561+++ b/cloudinit/config/cc_resolv_conf.py
3562@@ -1,22 +1,10 @@
3563-# vi: ts=4 expandtab
3564-#
3565-# Copyright (C) 2013 Craig Tracey
3566-# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3567-#
3568-# Author: Craig Tracey <craigtracey@gmail.com>
3569-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3570+# Copyright (C) 2013 Craig Tracey
3571+# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3572 #
3573-# This program is free software: you can redistribute it and/or modify
3574-# it under the terms of the GNU General Public License version 3, as
3575-# published by the Free Software Foundation.
3576+# Author: Craig Tracey <craigtracey@gmail.com>
3577+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3578 #
3579-# This program is distributed in the hope that it will be useful,
3580-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3581-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3582-# GNU General Public License for more details.
3583-#
3584-# You should have received a copy of the GNU General Public License
3585-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3586+# This file is part of cloud-init. See LICENSE file for license information.
3587
3588 """
3589 Resolv Conf
3590@@ -123,3 +111,5 @@ def handle(name, cfg, cloud, log, _args):
3591
3592 generate_resolv_conf(template_fn=template_fn, params=cfg["resolv_conf"])
3593 return
3594+
3595+# vi: ts=4 expandtab
3596diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py
3597index d858f65..7f36cf8 100644
3598--- a/cloudinit/config/cc_rh_subscription.py
3599+++ b/cloudinit/config/cc_rh_subscription.py
3600@@ -1,20 +1,8 @@
3601-# vi: ts=4 expandtab
3602-#
3603-# Copyright (C) 2015 Red Hat, Inc.
3604-#
3605-# Author: Brent Baude <bbaude@redhat.com>
3606+# Copyright (C) 2015 Red Hat, Inc.
3607 #
3608-# This program is free software: you can redistribute it and/or modify
3609-# it under the terms of the GNU General Public License version 3, as
3610-# published by the Free Software Foundation.
3611+# Author: Brent Baude <bbaude@redhat.com>
3612 #
3613-# This program is distributed in the hope that it will be useful,
3614-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3615-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3616-# GNU General Public License for more details.
3617-#
3618-# You should have received a copy of the GNU General Public License
3619-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3620+# This file is part of cloud-init. See LICENSE file for license information.
3621
3622 """
3623 RedHat Subscription
3624@@ -421,11 +409,12 @@ class SubscriptionManager(object):
3625 "because it is not enabled".format(fail))
3626
3627 cmd = ['repos']
3628- if len(enable_list) > 0:
3629- cmd.extend(enable_list)
3630 if len(disable_list) > 0:
3631 cmd.extend(disable_list)
3632
3633+ if len(enable_list) > 0:
3634+ cmd.extend(enable_list)
3635+
3636 try:
3637 self._sub_man_cli(cmd)
3638 except util.ProcessExecutionError as e:
3639@@ -442,3 +431,5 @@ class SubscriptionManager(object):
3640
3641 def is_configured(self):
3642 return bool((self.userid and self.password) or self.activation_key)
3643+
3644+# vi: ts=4 expandtab
3645diff --git a/cloudinit/config/cc_rightscale_userdata.py b/cloudinit/config/cc_rightscale_userdata.py
3646index 6cf8c94..4e34c7e 100644
3647--- a/cloudinit/config/cc_rightscale_userdata.py
3648+++ b/cloudinit/config/cc_rightscale_userdata.py
3649@@ -1,22 +1,10 @@
3650-# vi: ts=4 expandtab
3651-#
3652-# Copyright (C) 2011 Canonical Ltd.
3653-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3654-#
3655-# Author: Scott Moser <scott.moser@canonical.com>
3656-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3657+# Copyright (C) 2011 Canonical Ltd.
3658+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3659 #
3660-# This program is free software: you can redistribute it and/or modify
3661-# it under the terms of the GNU General Public License version 3, as
3662-# published by the Free Software Foundation.
3663+# Author: Scott Moser <scott.moser@canonical.com>
3664+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3665 #
3666-# This program is distributed in the hope that it will be useful,
3667-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3668-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3669-# GNU General Public License for more details.
3670-#
3671-# You should have received a copy of the GNU General Public License
3672-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3673+# This file is part of cloud-init. See LICENSE file for license information.
3674
3675 """
3676 Rightscale Userdata
3677@@ -126,3 +114,5 @@ def handle(name, _cfg, cloud, log, _args):
3678 log.warn("%s failed with exceptions, re-raising the last one",
3679 len(captured_excps))
3680 raise captured_excps[-1]
3681+
3682+# vi: ts=4 expandtab
3683diff --git a/cloudinit/config/cc_rsyslog.py b/cloudinit/config/cc_rsyslog.py
3684index 1c12e56..5031621 100644
3685--- a/cloudinit/config/cc_rsyslog.py
3686+++ b/cloudinit/config/cc_rsyslog.py
3687@@ -1,22 +1,11 @@
3688-# vi: ts=4 expandtab syntax=python
3689-#
3690-# Copyright (C) 2009-2010 Canonical Ltd.
3691-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3692-#
3693-# Author: Scott Moser <scott.moser@canonical.com>
3694-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3695-#
3696-# This program is free software: you can redistribute it and/or modify
3697-# it under the terms of the GNU General Public License version 3, as
3698-# published by the Free Software Foundation.
3699+# Copyright (C) 2009-2010 Canonical Ltd.
3700+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3701 #
3702-# This program is distributed in the hope that it will be useful,
3703-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3704-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3705-# GNU General Public License for more details.
3706+# Author: Scott Moser <scott.moser@canonical.com>
3707+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3708 #
3709-# You should have received a copy of the GNU General Public License
3710-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3711+# This file is part of cloud-init. See LICENSE file for license information.
3712+
3713 """
3714 .. _cc_rsyslog:
3715
3716@@ -451,3 +440,5 @@ def handle(name, cfg, cloud, log, _args):
3717 # This should now use rsyslog if
3718 # the logging was setup to use it...
3719 log.debug("%s configured %s files", name, changes)
3720+
3721+# vi: ts=4 expandtab syntax=python
3722diff --git a/cloudinit/config/cc_runcmd.py b/cloudinit/config/cc_runcmd.py
3723index 23e1e89..dfa8cb3 100644
3724--- a/cloudinit/config/cc_runcmd.py
3725+++ b/cloudinit/config/cc_runcmd.py
3726@@ -1,22 +1,10 @@
3727-# vi: ts=4 expandtab
3728-#
3729-# Copyright (C) 2009-2010 Canonical Ltd.
3730-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3731-#
3732-# Author: Scott Moser <scott.moser@canonical.com>
3733-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3734+# Copyright (C) 2009-2010 Canonical Ltd.
3735+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3736 #
3737-# This program is free software: you can redistribute it and/or modify
3738-# it under the terms of the GNU General Public License version 3, as
3739-# published by the Free Software Foundation.
3740+# Author: Scott Moser <scott.moser@canonical.com>
3741+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3742 #
3743-# This program is distributed in the hope that it will be useful,
3744-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3745-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3746-# GNU General Public License for more details.
3747-#
3748-# You should have received a copy of the GNU General Public License
3749-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3750+# This file is part of cloud-init. See LICENSE file for license information.
3751
3752 """
3753 Runcmd
3754@@ -68,3 +56,5 @@ def handle(name, cfg, cloud, log, _args):
3755 util.write_file(out_fn, content, 0o700)
3756 except Exception:
3757 util.logexc(log, "Failed to shellify %s into file %s", cmd, out_fn)
3758+
3759+# vi: ts=4 expandtab
3760diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py
3761index 9078665..2b38837 100644
3762--- a/cloudinit/config/cc_salt_minion.py
3763+++ b/cloudinit/config/cc_salt_minion.py
3764@@ -1,18 +1,6 @@
3765-# vi: ts=4 expandtab
3766-#
3767-# Author: Jeff Bauer <jbauer@rubic.com>
3768-#
3769-# This program is free software: you can redistribute it and/or modify
3770-# it under the terms of the GNU General Public License version 3, as
3771-# published by the Free Software Foundation.
3772+# Author: Jeff Bauer <jbauer@rubic.com>
3773 #
3774-# This program is distributed in the hope that it will be useful,
3775-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3776-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3777-# GNU General Public License for more details.
3778-#
3779-# You should have received a copy of the GNU General Public License
3780-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3781+# This file is part of cloud-init. See LICENSE file for license information.
3782
3783 """
3784 Salt Minion
3785@@ -95,3 +83,5 @@ def handle(name, cfg, cloud, log, _args):
3786 # restart salt-minion. 'service' will start even if not started. if it
3787 # was started, it needs to be restarted for config change.
3788 util.subp(['service', 'salt-minion', 'restart'], capture=False)
3789+
3790+# vi: ts=4 expandtab
3791diff --git a/cloudinit/config/cc_scripts_per_boot.py b/cloudinit/config/cc_scripts_per_boot.py
3792index 0736cf7..b03255c 100644
3793--- a/cloudinit/config/cc_scripts_per_boot.py
3794+++ b/cloudinit/config/cc_scripts_per_boot.py
3795@@ -1,22 +1,10 @@
3796-# vi: ts=4 expandtab
3797-#
3798-# Copyright (C) 2011 Canonical Ltd.
3799-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3800-#
3801-# Author: Scott Moser <scott.moser@canonical.com>
3802-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3803+# Copyright (C) 2011 Canonical Ltd.
3804+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3805 #
3806-# This program is free software: you can redistribute it and/or modify
3807-# it under the terms of the GNU General Public License version 3, as
3808-# published by the Free Software Foundation.
3809+# Author: Scott Moser <scott.moser@canonical.com>
3810+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3811 #
3812-# This program is distributed in the hope that it will be useful,
3813-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3814-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3815-# GNU General Public License for more details.
3816-#
3817-# You should have received a copy of the GNU General Public License
3818-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3819+# This file is part of cloud-init. See LICENSE file for license information.
3820
3821 """
3822 Scripts Per Boot
3823@@ -55,3 +43,5 @@ def handle(name, _cfg, cloud, log, _args):
3824 log.warn("Failed to run module %s (%s in %s)",
3825 name, SCRIPT_SUBDIR, runparts_path)
3826 raise
3827+
3828+# vi: ts=4 expandtab
3829diff --git a/cloudinit/config/cc_scripts_per_instance.py b/cloudinit/config/cc_scripts_per_instance.py
3830index c71d154..baee5cc 100644
3831--- a/cloudinit/config/cc_scripts_per_instance.py
3832+++ b/cloudinit/config/cc_scripts_per_instance.py
3833@@ -1,22 +1,10 @@
3834-# vi: ts=4 expandtab
3835-#
3836-# Copyright (C) 2011 Canonical Ltd.
3837-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3838-#
3839-# Author: Scott Moser <scott.moser@canonical.com>
3840-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3841+# Copyright (C) 2011 Canonical Ltd.
3842+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3843 #
3844-# This program is free software: you can redistribute it and/or modify
3845-# it under the terms of the GNU General Public License version 3, as
3846-# published by the Free Software Foundation.
3847+# Author: Scott Moser <scott.moser@canonical.com>
3848+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3849 #
3850-# This program is distributed in the hope that it will be useful,
3851-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3852-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3853-# GNU General Public License for more details.
3854-#
3855-# You should have received a copy of the GNU General Public License
3856-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3857+# This file is part of cloud-init. See LICENSE file for license information.
3858
3859 """
3860 Scripts Per Instance
3861@@ -55,3 +43,5 @@ def handle(name, _cfg, cloud, log, _args):
3862 log.warn("Failed to run module %s (%s in %s)",
3863 name, SCRIPT_SUBDIR, runparts_path)
3864 raise
3865+
3866+# vi: ts=4 expandtab
3867diff --git a/cloudinit/config/cc_scripts_per_once.py b/cloudinit/config/cc_scripts_per_once.py
3868index bf637ee..4943e9a 100644
3869--- a/cloudinit/config/cc_scripts_per_once.py
3870+++ b/cloudinit/config/cc_scripts_per_once.py
3871@@ -1,22 +1,10 @@
3872-# vi: ts=4 expandtab
3873-#
3874-# Copyright (C) 2011 Canonical Ltd.
3875-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3876-#
3877-# Author: Scott Moser <scott.moser@canonical.com>
3878-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3879+# Copyright (C) 2011 Canonical Ltd.
3880+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3881 #
3882-# This program is free software: you can redistribute it and/or modify
3883-# it under the terms of the GNU General Public License version 3, as
3884-# published by the Free Software Foundation.
3885+# Author: Scott Moser <scott.moser@canonical.com>
3886+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3887 #
3888-# This program is distributed in the hope that it will be useful,
3889-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3890-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3891-# GNU General Public License for more details.
3892-#
3893-# You should have received a copy of the GNU General Public License
3894-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3895+# This file is part of cloud-init. See LICENSE file for license information.
3896
3897 """
3898 Scripts Per Once
3899@@ -55,3 +43,5 @@ def handle(name, _cfg, cloud, log, _args):
3900 log.warn("Failed to run module %s (%s in %s)",
3901 name, SCRIPT_SUBDIR, runparts_path)
3902 raise
3903+
3904+# vi: ts=4 expandtab
3905diff --git a/cloudinit/config/cc_scripts_user.py b/cloudinit/config/cc_scripts_user.py
3906index 54338a4..6c66481 100644
3907--- a/cloudinit/config/cc_scripts_user.py
3908+++ b/cloudinit/config/cc_scripts_user.py
3909@@ -1,22 +1,10 @@
3910-# vi: ts=4 expandtab
3911-#
3912-# Copyright (C) 2011 Canonical Ltd.
3913-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3914-#
3915-# Author: Scott Moser <scott.moser@canonical.com>
3916-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3917+# Copyright (C) 2011 Canonical Ltd.
3918+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3919 #
3920-# This program is free software: you can redistribute it and/or modify
3921-# it under the terms of the GNU General Public License version 3, as
3922-# published by the Free Software Foundation.
3923+# Author: Scott Moser <scott.moser@canonical.com>
3924+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
3925 #
3926-# This program is distributed in the hope that it will be useful,
3927-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3928-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3929-# GNU General Public License for more details.
3930-#
3931-# You should have received a copy of the GNU General Public License
3932-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3933+# This file is part of cloud-init. See LICENSE file for license information.
3934
3935 """
3936 Scripts User
3937@@ -59,3 +47,5 @@ def handle(name, _cfg, cloud, log, _args):
3938 log.warn("Failed to run module %s (%s in %s)",
3939 name, SCRIPT_SUBDIR, runparts_path)
3940 raise
3941+
3942+# vi: ts=4 expandtab
3943diff --git a/cloudinit/config/cc_scripts_vendor.py b/cloudinit/config/cc_scripts_vendor.py
3944index b5777df..0292eaf 100644
3945--- a/cloudinit/config/cc_scripts_vendor.py
3946+++ b/cloudinit/config/cc_scripts_vendor.py
3947@@ -1,20 +1,8 @@
3948-# vi: ts=4 expandtab
3949-#
3950-# Copyright (C) 2014 Canonical Ltd.
3951-#
3952-# Author: Ben Howard <ben.howard@canonical.com>
3953+# Copyright (C) 2014 Canonical Ltd.
3954 #
3955-# This program is free software: you can redistribute it and/or modify
3956-# it under the terms of the GNU General Public License version 3, as
3957-# published by the Free Software Foundation.
3958+# Author: Ben Howard <ben.howard@canonical.com>
3959 #
3960-# This program is distributed in the hope that it will be useful,
3961-# but WITHOUT ANY WARRANTY; without even the implied warranty of
3962-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3963-# GNU General Public License for more details.
3964-#
3965-# You should have received a copy of the GNU General Public License
3966-# along with this program. If not, see <http://www.gnu.org/licenses/>.
3967+# This file is part of cloud-init. See LICENSE file for license information.
3968
3969 """
3970 Scripts Vendor
3971@@ -30,7 +18,7 @@ entry under the ``vendor_data`` config key.
3972
3973 **Module frequency:** per instance
3974
3975-**Supporte distros:** all
3976+**Supported distros:** all
3977
3978 **Config keys**::
3979
3980@@ -63,3 +51,5 @@ def handle(name, cfg, cloud, log, _args):
3981 log.warn("Failed to run module %s (%s in %s)",
3982 name, SCRIPT_SUBDIR, runparts_path)
3983 raise
3984+
3985+# vi: ts=4 expandtab
3986diff --git a/cloudinit/config/cc_seed_random.py b/cloudinit/config/cc_seed_random.py
3987index d84255e..e76b9c0 100644
3988--- a/cloudinit/config/cc_seed_random.py
3989+++ b/cloudinit/config/cc_seed_random.py
3990@@ -1,23 +1,11 @@
3991-# vi: ts=4 expandtab
3992-#
3993-# Copyright (C) 2013 Yahoo! Inc.
3994-# Copyright (C) 2014 Canonical, Ltd
3995-#
3996-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
3997-# Author: Dustin Kirkland <kirkland@ubuntu.com>
3998-# Author: Scott Moser <scott.moser@canonical.com>
3999+# Copyright (C) 2013 Yahoo! Inc.
4000+# Copyright (C) 2014 Canonical, Ltd
4001 #
4002-# This program is free software: you can redistribute it and/or modify
4003-# it under the terms of the GNU General Public License version 3, as
4004-# published by the Free Software Foundation.
4005+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4006+# Author: Dustin Kirkland <kirkland@ubuntu.com>
4007+# Author: Scott Moser <scott.moser@canonical.com>
4008 #
4009-# This program is distributed in the hope that it will be useful,
4010-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4011-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4012-# GNU General Public License for more details.
4013-#
4014-# You should have received a copy of the GNU General Public License
4015-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4016+# This file is part of cloud-init. See LICENSE file for license information.
4017
4018 """
4019 Seed Random
4020@@ -144,3 +132,5 @@ def handle(name, cfg, cloud, log, _args):
4021 except ValueError as e:
4022 log.warn("handling random command [%s] failed: %s", command, e)
4023 raise e
4024+
4025+# vi: ts=4 expandtab
4026diff --git a/cloudinit/config/cc_set_hostname.py b/cloudinit/config/cc_set_hostname.py
4027index c35cefe..aa3dfe5 100644
4028--- a/cloudinit/config/cc_set_hostname.py
4029+++ b/cloudinit/config/cc_set_hostname.py
4030@@ -1,22 +1,10 @@
4031-# vi: ts=4 expandtab
4032-#
4033-# Copyright (C) 2011 Canonical Ltd.
4034-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4035-#
4036-# Author: Scott Moser <scott.moser@canonical.com>
4037-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4038+# Copyright (C) 2011 Canonical Ltd.
4039+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4040 #
4041-# This program is free software: you can redistribute it and/or modify
4042-# it under the terms of the GNU General Public License version 3, as
4043-# published by the Free Software Foundation.
4044+# Author: Scott Moser <scott.moser@canonical.com>
4045+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4046 #
4047-# This program is distributed in the hope that it will be useful,
4048-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4049-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4050-# GNU General Public License for more details.
4051-#
4052-# You should have received a copy of the GNU General Public License
4053-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4054+# This file is part of cloud-init. See LICENSE file for license information.
4055
4056 """
4057 Set Hostname
4058@@ -39,7 +27,7 @@ will be used.
4059
4060 **Config keys**::
4061
4062- perserve_hostname: <true/false>
4063+ preserve_hostname: <true/false>
4064 fqdn: <fqdn>
4065 hostname: <fqdn/hostname>
4066 """
4067@@ -61,3 +49,5 @@ def handle(name, cfg, cloud, log, _args):
4068 util.logexc(log, "Failed to set the hostname to %s (%s)", fqdn,
4069 hostname)
4070 raise
4071+
4072+# vi: ts=4 expandtab
4073diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
4074index 5dd4b01..db27b7a 100755
4075--- a/cloudinit/config/cc_set_passwords.py
4076+++ b/cloudinit/config/cc_set_passwords.py
4077@@ -1,22 +1,10 @@
4078-# vi: ts=4 expandtab
4079-#
4080-# Copyright (C) 2009-2010 Canonical Ltd.
4081-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4082-#
4083-# Author: Scott Moser <scott.moser@canonical.com>
4084-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4085-#
4086-# This program is free software: you can redistribute it and/or modify
4087-# it under the terms of the GNU General Public License version 3, as
4088-# published by the Free Software Foundation.
4089+# Copyright (C) 2009-2010 Canonical Ltd.
4090+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4091 #
4092-# This program is distributed in the hope that it will be useful,
4093-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4094-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4095-# GNU General Public License for more details.
4096+# Author: Scott Moser <scott.moser@canonical.com>
4097+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4098 #
4099-# You should have received a copy of the GNU General Public License
4100-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4101+# This file is part of cloud-init. See LICENSE file for license information.
4102
4103 """
4104 Set Passwords
4105@@ -58,6 +46,16 @@ enabled, disabled, or left to system defaults using ``ssh_pwauth``.
4106 expire: <true/false>
4107
4108 chpasswd:
4109+ list: |
4110+ user1:password1
4111+ user2:RANDOM
4112+ user3:password3
4113+ user4:R
4114+
4115+ ##
4116+ # or as yaml list
4117+ ##
4118+ chpasswd:
4119 list:
4120 - user1:password1
4121 - user2:RANDOM
4122@@ -94,14 +92,23 @@ def handle(_name, cfg, cloud, log, args):
4123
4124 if 'chpasswd' in cfg:
4125 chfg = cfg['chpasswd']
4126- plist = util.get_cfg_option_str(chfg, 'list', plist)
4127+ if 'list' in chfg and chfg['list']:
4128+ if isinstance(chfg['list'], list):
4129+ log.debug("Handling input for chpasswd as list.")
4130+ plist = util.get_cfg_option_list(chfg, 'list', plist)
4131+ else:
4132+ log.debug("Handling input for chpasswd as multiline string.")
4133+ plist = util.get_cfg_option_str(chfg, 'list', plist)
4134+ if plist:
4135+ plist = plist.splitlines()
4136+
4137 expire = util.get_cfg_option_bool(chfg, 'expire', expire)
4138
4139 if not plist and password:
4140 (users, _groups) = ug_util.normalize_users_groups(cfg, cloud.distro)
4141 (user, _user_config) = ug_util.extract_default(users)
4142 if user:
4143- plist = "%s:%s" % (user, password)
4144+ plist = ["%s:%s" % (user, password)]
4145 else:
4146 log.warn("No default or defined user to change password for.")
4147
4148@@ -112,6 +119,7 @@ def handle(_name, cfg, cloud, log, args):
4149 hashed_users = []
4150 randlist = []
4151 users = []
4152+<<<<<<< cloudinit/config/cc_set_passwords.py
4153
4154 prog = re.compile(r'\$[1,2a,2y,5,6](\$.+){2}')
4155
4156@@ -124,6 +132,18 @@ def handle(_name, cfg, cloud, log, args):
4157 hashed_plist_in.append("%s:%s" % (u, p))
4158 hashed_users.append(u)
4159 else:
4160+=======
4161+ prog = re.compile(r'\$[1,2a,2y,5,6](\$.+){2}')
4162+ for line in plist:
4163+ u, p = line.split(':', 1)
4164+ if prog.match(p) is not None and ":" not in p:
4165+ hashed_plist_in.append("%s:%s" % (u, p))
4166+ hashed_users.append(u)
4167+ else:
4168+ if p == "R" or p == "RANDOM":
4169+ p = rand_user_password()
4170+ randlist.append("%s:%s" % (u, p))
4171+>>>>>>> cloudinit/config/cc_set_passwords.py
4172 plist_in.append("%s:%s" % (u, p))
4173 users.append(u)
4174
4175@@ -134,9 +154,14 @@ def handle(_name, cfg, cloud, log, args):
4176 util.subp(['chpasswd'], ch_in)
4177 except Exception as e:
4178 errors.append(e)
4179+<<<<<<< cloudinit/config/cc_set_passwords.py
4180 util.logexc(log,
4181 "Failed to set passwords with chpasswd for %s",
4182 users)
4183+=======
4184+ util.logexc(
4185+ log, "Failed to set passwords with chpasswd for %s", users)
4186+>>>>>>> cloudinit/config/cc_set_passwords.py
4187
4188 hashed_ch_in = '\n'.join(hashed_plist_in) + '\n'
4189 if hashed_users:
4190@@ -145,9 +170,15 @@ def handle(_name, cfg, cloud, log, args):
4191 util.subp(['chpasswd', '-e'], hashed_ch_in)
4192 except Exception as e:
4193 errors.append(e)
4194+<<<<<<< cloudinit/config/cc_set_passwords.py
4195 util.logexc(log,
4196 "Failed to set hashed passwords with chpasswd for %s",
4197 hashed_users)
4198+=======
4199+ util.logexc(
4200+ log, "Failed to set hashed passwords with chpasswd for %s",
4201+ hashed_users)
4202+>>>>>>> cloudinit/config/cc_set_passwords.py
4203
4204 if len(randlist):
4205 blurb = ("Set the following 'random' passwords\n",
4206@@ -232,3 +263,5 @@ def handle(_name, cfg, cloud, log, args):
4207
4208 def rand_user_password(pwlen=9):
4209 return util.rand_str(pwlen, select_from=PW_SET)
4210+
4211+# vi: ts=4 expandtab
4212diff --git a/cloudinit/config/cc_snap_config.py b/cloudinit/config/cc_snap_config.py
4213index 275a2d0..db51166 100644
4214--- a/cloudinit/config/cc_snap_config.py
4215+++ b/cloudinit/config/cc_snap_config.py
4216@@ -1,20 +1,8 @@
4217-# vi: ts=4 expandtab
4218-#
4219-# Copyright (C) 2016 Canonical Ltd.
4220-#
4221-# Author: Ryan Harper <ryan.harper@canonical.com>
4222+# Copyright (C) 2016 Canonical Ltd.
4223 #
4224-# This program is free software: you can redistribute it and/or modify
4225-# it under the terms of the GNU General Public License version 3, as
4226-# published by the Free Software Foundation.
4227+# Author: Ryan Harper <ryan.harper@canonical.com>
4228 #
4229-# This program is distributed in the hope that it will be useful,
4230-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4231-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4232-# GNU General Public License for more details.
4233-#
4234-# You should have received a copy of the GNU General Public License
4235-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4236+# This file is part of cloud-init. See LICENSE file for license information.
4237
4238 """
4239 Snappy
4240@@ -182,3 +170,5 @@ def handle(name, cfg, cloud, log, args):
4241 usercfg = add_snap_user(cfg=cfgin)
4242 if usercfg:
4243 cloud.distro.create_user(usercfg.get('snapuser'), **usercfg)
4244+
4245+# vi: ts=4 expandtab
4246diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py
4247index e03ec48..6ea81b8 100644
4248--- a/cloudinit/config/cc_snappy.py
4249+++ b/cloudinit/config/cc_snappy.py
4250@@ -1,16 +1,4 @@
4251-# vi: ts=4 expandtab
4252-#
4253-# This program is free software: you can redistribute it and/or modify
4254-# it under the terms of the GNU General Public License version 3, as
4255-# published by the Free Software Foundation.
4256-#
4257-# This program is distributed in the hope that it will be useful,
4258-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4259-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4260-# GNU General Public License for more details.
4261-#
4262-# You should have received a copy of the GNU General Public License
4263-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4264+# This file is part of cloud-init. See LICENSE file for license information.
4265
4266 """
4267 Snappy
4268@@ -321,3 +309,5 @@ def handle(name, cfg, cloud, log, args):
4269
4270 if fails:
4271 raise Exception("failed to install/configure snaps")
4272+
4273+# vi: ts=4 expandtab
4274diff --git a/cloudinit/config/cc_spacewalk.py b/cloudinit/config/cc_spacewalk.py
4275index 99b63a8..1020e94 100644
4276--- a/cloudinit/config/cc_spacewalk.py
4277+++ b/cloudinit/config/cc_spacewalk.py
4278@@ -1,16 +1,4 @@
4279-# vi: ts=4 expandtab
4280-#
4281-# This program is free software: you can redistribute it and/or modify
4282-# it under the terms of the GNU General Public License version 3, as
4283-# published by the Free Software Foundation.
4284-#
4285-# This program is distributed in the hope that it will be useful,
4286-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4287-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4288-# GNU General Public License for more details.
4289-#
4290-# You should have received a copy of the GNU General Public License
4291-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4292+# This file is part of cloud-init. See LICENSE file for license information.
4293
4294 """
4295 Spacewalk
4296@@ -98,3 +86,5 @@ def handle(name, cfg, cloud, log, _args):
4297 else:
4298 log.debug("Skipping module named %s, 'spacewalk/server' key"
4299 " was not found in configuration", name)
4300+
4301+# vi: ts=4 expandtab
4302diff --git a/cloudinit/config/cc_ssh.py b/cloudinit/config/cc_ssh.py
4303index 576fa58..45204a0 100755
4304--- a/cloudinit/config/cc_ssh.py
4305+++ b/cloudinit/config/cc_ssh.py
4306@@ -1,22 +1,10 @@
4307-# vi: ts=4 expandtab
4308-#
4309-# Copyright (C) 2009-2010 Canonical Ltd.
4310-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4311-#
4312-# Author: Scott Moser <scott.moser@canonical.com>
4313-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4314+# Copyright (C) 2009-2010 Canonical Ltd.
4315+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4316 #
4317-# This program is free software: you can redistribute it and/or modify
4318-# it under the terms of the GNU General Public License version 3, as
4319-# published by the Free Software Foundation.
4320+# Author: Scott Moser <scott.moser@canonical.com>
4321+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4322 #
4323-# This program is distributed in the hope that it will be useful,
4324-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4325-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4326-# GNU General Public License for more details.
4327-#
4328-# You should have received a copy of the GNU General Public License
4329-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4330+# This file is part of cloud-init. See LICENSE file for license information.
4331
4332 """
4333 SSH
4334@@ -223,3 +211,5 @@ def apply_credentials(keys, user, disable_root, disable_root_opts):
4335 key_prefix = ''
4336
4337 ssh_util.setup_user_keys(keys, 'root', options=key_prefix)
4338+
4339+# vi: ts=4 expandtab
4340diff --git a/cloudinit/config/cc_ssh_authkey_fingerprints.py b/cloudinit/config/cc_ssh_authkey_fingerprints.py
4341index 7eeb0f8..0066e97 100755
4342--- a/cloudinit/config/cc_ssh_authkey_fingerprints.py
4343+++ b/cloudinit/config/cc_ssh_authkey_fingerprints.py
4344@@ -1,20 +1,8 @@
4345-# vi: ts=4 expandtab
4346-#
4347-# Copyright (C) 2012 Yahoo! Inc.
4348-#
4349-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4350+# Copyright (C) 2012 Yahoo! Inc.
4351 #
4352-# This program is free software: you can redistribute it and/or modify
4353-# it under the terms of the GNU General Public License version 3, as
4354-# published by the Free Software Foundation.
4355+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4356 #
4357-# This program is distributed in the hope that it will be useful,
4358-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4359-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4360-# GNU General Public License for more details.
4361-#
4362-# You should have received a copy of the GNU General Public License
4363-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4364+# This file is part of cloud-init. See LICENSE file for license information.
4365
4366 """
4367 SSH Authkey Fingerprints
4368@@ -120,3 +108,5 @@ def handle(name, cfg, cloud, log, _args):
4369 (key_fn, key_entries) = ssh_util.extract_authorized_keys(user_name)
4370 _pprint_key_entries(user_name, key_fn,
4371 key_entries, hash_meth)
4372+
4373+# vi: ts=4 expandtab
4374diff --git a/cloudinit/config/cc_ssh_import_id.py b/cloudinit/config/cc_ssh_import_id.py
4375index 1be96dc..6b46daf 100755
4376--- a/cloudinit/config/cc_ssh_import_id.py
4377+++ b/cloudinit/config/cc_ssh_import_id.py
4378@@ -1,22 +1,10 @@
4379-# vi: ts=4 expandtab
4380-#
4381-# Copyright (C) 2009-2010 Canonical Ltd.
4382-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4383-#
4384-# Author: Scott Moser <scott.moser@canonical.com>
4385-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4386+# Copyright (C) 2009-2010 Canonical Ltd.
4387+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4388 #
4389-# This program is free software: you can redistribute it and/or modify
4390-# it under the terms of the GNU General Public License version 3, as
4391-# published by the Free Software Foundation.
4392+# Author: Scott Moser <scott.moser@canonical.com>
4393+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4394 #
4395-# This program is distributed in the hope that it will be useful,
4396-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4397-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4398-# GNU General Public License for more details.
4399-#
4400-# You should have received a copy of the GNU General Public License
4401-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4402+# This file is part of cloud-init. See LICENSE file for license information.
4403
4404 """
4405 SSH Import Id
4406@@ -117,3 +105,5 @@ def import_ssh_ids(ids, user, log):
4407 except util.ProcessExecutionError as exc:
4408 util.logexc(log, "Failed to run command to import %s ssh ids", user)
4409 raise exc
4410+
4411+# vi: ts=4 expandtab
4412diff --git a/cloudinit/config/cc_timezone.py b/cloudinit/config/cc_timezone.py
4413index 7024b07..a9de8fa 100644
4414--- a/cloudinit/config/cc_timezone.py
4415+++ b/cloudinit/config/cc_timezone.py
4416@@ -1,22 +1,10 @@
4417-# vi: ts=4 expandtab
4418-#
4419-# Copyright (C) 2009-2010 Canonical Ltd.
4420-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4421-#
4422-# Author: Scott Moser <scott.moser@canonical.com>
4423-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4424+# Copyright (C) 2009-2010 Canonical Ltd.
4425+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4426 #
4427-# This program is free software: you can redistribute it and/or modify
4428-# it under the terms of the GNU General Public License version 3, as
4429-# published by the Free Software Foundation.
4430+# Author: Scott Moser <scott.moser@canonical.com>
4431+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4432 #
4433-# This program is distributed in the hope that it will be useful,
4434-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4435-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4436-# GNU General Public License for more details.
4437-#
4438-# You should have received a copy of the GNU General Public License
4439-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4440+# This file is part of cloud-init. See LICENSE file for license information.
4441
4442 """
4443 Timezone
4444@@ -57,3 +45,5 @@ def handle(name, cfg, cloud, log, args):
4445
4446 # Let the distro handle settings its timezone
4447 cloud.distro.set_timezone(timezone)
4448+
4449+# vi: ts=4 expandtab
4450diff --git a/cloudinit/config/cc_ubuntu_init_switch.py b/cloudinit/config/cc_ubuntu_init_switch.py
4451index 31a96e4..5dd2690 100644
4452--- a/cloudinit/config/cc_ubuntu_init_switch.py
4453+++ b/cloudinit/config/cc_ubuntu_init_switch.py
4454@@ -1,20 +1,8 @@
4455-# vi: ts=4 expandtab
4456-#
4457-# Copyright (C) 2014 Canonical Ltd.
4458-#
4459-# Author: Scott Moser <scott.moser@canonical.com>
4460+# Copyright (C) 2014 Canonical Ltd.
4461 #
4462-# This program is free software: you can redistribute it and/or modify
4463-# it under the terms of the GNU General Public License version 3, as
4464-# published by the Free Software Foundation.
4465+# Author: Scott Moser <scott.moser@canonical.com>
4466 #
4467-# This program is distributed in the hope that it will be useful,
4468-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4469-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4470-# GNU General Public License for more details.
4471-#
4472-# You should have received a copy of the GNU General Public License
4473-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4474+# This file is part of cloud-init. See LICENSE file for license information.
4475
4476 """
4477 Ubuntu Init Switch
4478@@ -168,3 +156,5 @@ def _fire_reboot(log, wait_attempts=6, initial_sleep=1, backoff=2):
4479 elapsed = time.time() - start
4480 raise RuntimeError(("Reboot did not happen"
4481 " after %s seconds!") % (int(elapsed)))
4482+
4483+# vi: ts=4 expandtab
4484diff --git a/cloudinit/config/cc_update_etc_hosts.py b/cloudinit/config/cc_update_etc_hosts.py
4485index 3fcb265..b394784 100644
4486--- a/cloudinit/config/cc_update_etc_hosts.py
4487+++ b/cloudinit/config/cc_update_etc_hosts.py
4488@@ -1,22 +1,10 @@
4489-# vi: ts=4 expandtab
4490-#
4491-# Copyright (C) 2011 Canonical Ltd.
4492-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4493-#
4494-# Author: Scott Moser <scott.moser@canonical.com>
4495-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4496+# Copyright (C) 2011 Canonical Ltd.
4497+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4498 #
4499-# This program is free software: you can redistribute it and/or modify
4500-# it under the terms of the GNU General Public License version 3, as
4501-# published by the Free Software Foundation.
4502+# Author: Scott Moser <scott.moser@canonical.com>
4503+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4504 #
4505-# This program is distributed in the hope that it will be useful,
4506-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4507-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4508-# GNU General Public License for more details.
4509-#
4510-# You should have received a copy of the GNU General Public License
4511-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4512+# This file is part of cloud-init. See LICENSE file for license information.
4513
4514 """
4515 Update Etc Hosts
4516@@ -101,3 +89,5 @@ def handle(name, cfg, cloud, log, _args):
4517 else:
4518 log.debug(("Configuration option 'manage_etc_hosts' is not set,"
4519 " not managing /etc/hosts in module %s"), name)
4520+
4521+# vi: ts=4 expandtab
4522diff --git a/cloudinit/config/cc_update_hostname.py b/cloudinit/config/cc_update_hostname.py
4523index 315b7b6..d5f4eb5 100644
4524--- a/cloudinit/config/cc_update_hostname.py
4525+++ b/cloudinit/config/cc_update_hostname.py
4526@@ -1,22 +1,10 @@
4527-# vi: ts=4 expandtab
4528-#
4529-# Copyright (C) 2011 Canonical Ltd.
4530-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4531-#
4532-# Author: Scott Moser <scott.moser@canonical.com>
4533-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4534+# Copyright (C) 2011 Canonical Ltd.
4535+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4536 #
4537-# This program is free software: you can redistribute it and/or modify
4538-# it under the terms of the GNU General Public License version 3, as
4539-# published by the Free Software Foundation.
4540+# Author: Scott Moser <scott.moser@canonical.com>
4541+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4542 #
4543-# This program is distributed in the hope that it will be useful,
4544-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4545-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4546-# GNU General Public License for more details.
4547-#
4548-# You should have received a copy of the GNU General Public License
4549-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4550+# This file is part of cloud-init. See LICENSE file for license information.
4551
4552 """
4553 Update Hostname
4554@@ -66,3 +54,5 @@ def handle(name, cfg, cloud, log, _args):
4555 util.logexc(log, "Failed to update the hostname to %s (%s)", fqdn,
4556 hostname)
4557 raise
4558+
4559+# vi: ts=4 expandtab
4560diff --git a/cloudinit/config/cc_users_groups.py b/cloudinit/config/cc_users_groups.py
4561index 3635236..5964980 100644
4562--- a/cloudinit/config/cc_users_groups.py
4563+++ b/cloudinit/config/cc_users_groups.py
4564@@ -1,20 +1,8 @@
4565-# vi: ts=4 expandtab
4566-#
4567-# Copyright (C) 2012 Canonical Ltd.
4568-#
4569-# Author: Ben Howard <ben.howard@canonical.com>
4570+# Copyright (C) 2012 Canonical Ltd.
4571 #
4572-# This program is free software: you can redistribute it and/or modify
4573-# it under the terms of the GNU General Public License version 3, as
4574-# published by the Free Software Foundation.
4575+# Author: Ben Howard <ben.howard@canonical.com>
4576 #
4577-# This program is distributed in the hope that it will be useful,
4578-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4579-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4580-# GNU General Public License for more details.
4581-#
4582-# You should have received a copy of the GNU General Public License
4583-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4584+# This file is part of cloud-init. See LICENSE file for license information.
4585
4586 """
4587 Users and Groups
4588@@ -112,3 +100,5 @@ def handle(name, cfg, cloud, _log, _args):
4589 cloud.distro.create_group(name, members)
4590 for (user, config) in users.items():
4591 cloud.distro.create_user(user, **config)
4592+
4593+# vi: ts=4 expandtab
4594diff --git a/cloudinit/config/cc_write_files.py b/cloudinit/config/cc_write_files.py
4595index b5956bd..72e1cdd 100644
4596--- a/cloudinit/config/cc_write_files.py
4597+++ b/cloudinit/config/cc_write_files.py
4598@@ -1,20 +1,8 @@
4599-# vi: ts=4 expandtab
4600-#
4601-# Copyright (C) 2012 Yahoo! Inc.
4602-#
4603-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4604+# Copyright (C) 2012 Yahoo! Inc.
4605 #
4606-# This program is free software: you can redistribute it and/or modify
4607-# it under the terms of the GNU General Public License version 3, as
4608-# published by the Free Software Foundation.
4609+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4610 #
4611-# This program is distributed in the hope that it will be useful,
4612-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4613-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4614-# GNU General Public License for more details.
4615-#
4616-# You should have received a copy of the GNU General Public License
4617-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4618+# This file is part of cloud-init. See LICENSE file for license information.
4619
4620 """
4621 Write Files
4622@@ -145,3 +133,5 @@ def extract_contents(contents, extraction_types):
4623 elif t == UNKNOWN_ENC:
4624 pass
4625 return result
4626+
4627+# vi: ts=4 expandtab
4628diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py
4629index eb94c1f..ef8535e 100644
4630--- a/cloudinit/config/cc_yum_add_repo.py
4631+++ b/cloudinit/config/cc_yum_add_repo.py
4632@@ -1,20 +1,8 @@
4633-# vi: ts=4 expandtab
4634-#
4635-# Copyright (C) 2012 Yahoo! Inc.
4636-#
4637-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4638+# Copyright (C) 2012 Yahoo! Inc.
4639 #
4640-# This program is free software: you can redistribute it and/or modify
4641-# it under the terms of the GNU General Public License version 3, as
4642-# published by the Free Software Foundation.
4643+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4644 #
4645-# This program is distributed in the hope that it will be useful,
4646-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4647-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4648-# GNU General Public License for more details.
4649-#
4650-# You should have received a copy of the GNU General Public License
4651-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4652+# This file is part of cloud-init. See LICENSE file for license information.
4653
4654 """
4655 Yum Add Repo
4656@@ -133,3 +121,5 @@ def handle(name, cfg, _cloud, log, _args):
4657 repo_blob = _format_repository_config(c_repo_id,
4658 repo_configs.get(c_repo_id))
4659 util.write_file(path, repo_blob)
4660+
4661+# vi: ts=4 expandtab
4662diff --git a/cloudinit/cs_utils.py b/cloudinit/cs_utils.py
4663index 412431f..51c0958 100644
4664--- a/cloudinit/cs_utils.py
4665+++ b/cloudinit/cs_utils.py
4666@@ -1,20 +1,9 @@
4667-# vi: ts=4 expandtab
4668-#
4669-# Copyright (C) 2014 CloudSigma
4670-#
4671-# Author: Kiril Vladimiroff <kiril.vladimiroff@cloudsigma.com>
4672-#
4673-# This program is free software: you can redistribute it and/or modify
4674-# it under the terms of the GNU General Public License version 3, as
4675-# published by the Free Software Foundation.
4676+# Copyright (C) 2014 CloudSigma
4677 #
4678-# This program is distributed in the hope that it will be useful,
4679-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4680-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4681-# GNU General Public License for more details.
4682+# Author: Kiril Vladimiroff <kiril.vladimiroff@cloudsigma.com>
4683 #
4684-# You should have received a copy of the GNU General Public License
4685-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4686+# This file is part of cloud-init. See LICENSE file for license information.
4687+
4688 """
4689 cepko implements easy-to-use communication with CloudSigma's VMs through
4690 a virtual serial port without bothering with formatting the messages
4691@@ -104,3 +93,5 @@ class CepkoResult(object):
4692
4693 def __iter__(self):
4694 return self.result.__iter__()
4695+
4696+# vi: ts=4 expandtab
4697diff --git a/cloudinit/dhclient_hook.py b/cloudinit/dhclient_hook.py
4698index 82cb185..7f02d7f 100644
4699--- a/cloudinit/dhclient_hook.py
4700+++ b/cloudinit/dhclient_hook.py
4701@@ -1,5 +1,4 @@
4702-#!/usr/bin/python
4703-# vi: ts=4 expandtab
4704+# This file is part of cloud-init. See LICENSE file for license information.
4705
4706 import os
4707
4708@@ -48,3 +47,5 @@ class LogDhclient(object):
4709 return
4710 atomic_helper.write_json(self.hook_file, self.get_vals(envs))
4711 LOG.debug("Wrote dhclient options in %s", self.hook_file)
4712+
4713+# vi: ts=4 expandtab
4714diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
4715index 4a72643..803ac74 100755
4716--- a/cloudinit/distros/__init__.py
4717+++ b/cloudinit/distros/__init__.py
4718@@ -1,25 +1,13 @@
4719-# vi: ts=4 expandtab
4720-#
4721-# Copyright (C) 2012 Canonical Ltd.
4722-# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4723-# Copyright (C) 2012 Yahoo! Inc.
4724-#
4725-# Author: Scott Moser <scott.moser@canonical.com>
4726-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4727-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4728-# Author: Ben Howard <ben.howard@canonical.com>
4729+# Copyright (C) 2012 Canonical Ltd.
4730+# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
4731+# Copyright (C) 2012 Yahoo! Inc.
4732 #
4733-# This program is free software: you can redistribute it and/or modify
4734-# it under the terms of the GNU General Public License version 3, as
4735-# published by the Free Software Foundation.
4736+# Author: Scott Moser <scott.moser@canonical.com>
4737+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4738+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4739+# Author: Ben Howard <ben.howard@canonical.com>
4740 #
4741-# This program is distributed in the hope that it will be useful,
4742-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4743-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4744-# GNU General Public License for more details.
4745-#
4746-# You should have received a copy of the GNU General Public License
4747-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4748+# This file is part of cloud-init. See LICENSE file for license information.
4749
4750 import six
4751 from six import StringIO
4752@@ -34,6 +22,7 @@ from cloudinit import log as logging
4753 from cloudinit import net
4754 from cloudinit.net import eni
4755 from cloudinit.net import network_state
4756+from cloudinit.net import renderers
4757 from cloudinit import ssh_util
4758 from cloudinit import type_utils
4759 from cloudinit import util
4760@@ -62,6 +51,7 @@ class Distro(object):
4761 hostname_conf_fn = "/etc/hostname"
4762 tz_zone_dir = "/usr/share/zoneinfo"
4763 init_cmd = ['service'] # systemctl, service etc
4764+ renderer_configs = {}
4765
4766 def __init__(self, name, cfg, paths):
4767 self._paths = paths
4768@@ -81,6 +71,17 @@ class Distro(object):
4769 def _write_network_config(self, settings):
4770 raise NotImplementedError()
4771
4772+ def _supported_write_network_config(self, network_config):
4773+ priority = util.get_cfg_by_path(
4774+ self._cfg, ('network', 'renderers'), None)
4775+
4776+ name, render_cls = renderers.select(priority=priority)
4777+ LOG.debug("Selected renderer '%s' from priority list: %s",
4778+ name, priority)
4779+ renderer = render_cls(config=self.renderer_configs.get(name))
4780+ renderer.render_network_config(network_config=network_config)
4781+ return []
4782+
4783 def _find_tz_file(self, tz):
4784 tz_file = os.path.join(self.tz_zone_dir, str(tz))
4785 if not os.path.isfile(tz_file):
4786@@ -398,13 +399,17 @@ class Distro(object):
4787 # support kwargs having groups=[list] or groups="g1,g2"
4788 groups = kwargs.get('groups')
4789 if groups:
4790- if isinstance(groups, (list, tuple)):
4791- # kwargs.items loop below wants a comma delimeted string
4792- # that can go right through to the command.
4793- kwargs['groups'] = ",".join(groups)
4794- else:
4795+ if isinstance(groups, six.string_types):
4796 groups = groups.split(",")
4797
4798+ # remove any white spaces in group names, most likely
4799+ # that came in as a string like: groups: group1, group2
4800+ groups = [g.strip() for g in groups]
4801+
4802+ # kwargs.items loop below wants a comma delimeted string
4803+ # that can go right through to the command.
4804+ kwargs['groups'] = ",".join(groups)
4805+
4806 primary_group = kwargs.get('primary_group')
4807 if primary_group:
4808 groups.append(primary_group)
4809@@ -413,10 +418,10 @@ class Distro(object):
4810 for group in groups:
4811 if not util.is_group(group):
4812 self.create_group(group)
4813- LOG.debug("created group %s for user %s", name, group)
4814+ LOG.debug("created group '%s' for user '%s'", group, name)
4815
4816 # Check the values and create the command
4817- for key, val in kwargs.items():
4818+ for key, val in sorted(kwargs.items()):
4819
4820 if key in adduser_opts and val and isinstance(val, str):
4821 adduser_cmd.extend([adduser_opts[key], val])
4822@@ -433,7 +438,7 @@ class Distro(object):
4823
4824 # Don't create the home directory if directed so or if the user is a
4825 # system user
4826- if 'no_create_home' in kwargs or 'system' in kwargs:
4827+ if kwargs.get('no_create_home') or kwargs.get('system'):
4828 adduser_cmd.append('-M')
4829 log_adduser_cmd.append('-M')
4830 else:
4831@@ -744,3 +749,5 @@ def set_etc_timezone(tz, tz_file=None, tz_conf="/etc/timezone",
4832 else:
4833 util.copy(tz_file, tz_local)
4834 return
4835+
4836+# vi: ts=4 expandtab
4837diff --git a/cloudinit/distros/arch.py b/cloudinit/distros/arch.py
4838index 66209f2..64b8c1f 100644
4839--- a/cloudinit/distros/arch.py
4840+++ b/cloudinit/distros/arch.py
4841@@ -1,20 +1,8 @@
4842-# vi: ts=4 expandtab
4843-#
4844-# Copyright (C) 2014 Rackspace, US Inc.
4845-#
4846-# Author: Nate House <nathan.house@rackspace.com>
4847+# Copyright (C) 2014 Rackspace, US Inc.
4848 #
4849-# This program is free software: you can redistribute it and/or modify
4850-# it under the terms of the GNU General Public License version 3, as
4851-# published by the Free Software Foundation.
4852+# Author: Nate House <nathan.house@rackspace.com>
4853 #
4854-# This program is distributed in the hope that it will be useful,
4855-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4856-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4857-# GNU General Public License for more details.
4858-#
4859-# You should have received a copy of the GNU General Public License
4860-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4861+# This file is part of cloud-init. See LICENSE file for license information.
4862
4863 from cloudinit import distros
4864 from cloudinit import helpers
4865@@ -199,3 +187,5 @@ def convert_resolv_conf(settings):
4866 for ns in settings:
4867 result = result + 'nameserver %s\n' % ns
4868 return result
4869+
4870+# vi: ts=4 expandtab
4871diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
4872index f9b3b92..3f0f9d5 100644
4873--- a/cloudinit/distros/debian.py
4874+++ b/cloudinit/distros/debian.py
4875@@ -1,32 +1,18 @@
4876-# vi: ts=4 expandtab
4877-#
4878-# Copyright (C) 2012 Canonical Ltd.
4879-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4880-# Copyright (C) 2012 Yahoo! Inc.
4881-#
4882-# Author: Scott Moser <scott.moser@canonical.com>
4883-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4884-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4885-#
4886-# This program is free software: you can redistribute it and/or modify
4887-# it under the terms of the GNU General Public License version 3, as
4888-# published by the Free Software Foundation.
4889+# Copyright (C) 2012 Canonical Ltd.
4890+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4891+# Copyright (C) 2012 Yahoo! Inc.
4892 #
4893-# This program is distributed in the hope that it will be useful,
4894-# but WITHOUT ANY WARRANTY; without even the implied warranty of
4895-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4896-# GNU General Public License for more details.
4897+# Author: Scott Moser <scott.moser@canonical.com>
4898+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4899+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4900 #
4901-# You should have received a copy of the GNU General Public License
4902-# along with this program. If not, see <http://www.gnu.org/licenses/>.
4903+# This file is part of cloud-init. See LICENSE file for license information.
4904
4905 import os
4906
4907 from cloudinit import distros
4908 from cloudinit import helpers
4909 from cloudinit import log as logging
4910-from cloudinit.net import eni
4911-from cloudinit.net.network_state import parse_net_config_data
4912 from cloudinit import util
4913
4914 from cloudinit.distros.parsers.hostname import HostnameConf
4915@@ -50,11 +36,23 @@ ENI_HEADER = """# This file is generated from information provided by
4916 # network: {config: disabled}
4917 """
4918
4919+NETWORK_CONF_FN = "/etc/network/interfaces.d/50-cloud-init.cfg"
4920+
4921
4922 class Distro(distros.Distro):
4923 hostname_conf_fn = "/etc/hostname"
4924 locale_conf_fn = "/etc/default/locale"
4925- network_conf_fn = "/etc/network/interfaces.d/50-cloud-init.cfg"
4926+ network_conf_fn = {
4927+ "eni": "/etc/network/interfaces.d/50-cloud-init.cfg",
4928+ "netplan": "/etc/netplan/50-cloud-init.yaml"
4929+ }
4930+ renderer_configs = {
4931+ "eni": {"eni_path": network_conf_fn["eni"],
4932+ "eni_header": ENI_HEADER},
4933+ "netplan": {"netplan_path": network_conf_fn["netplan"],
4934+ "netplan_header": ENI_HEADER,
4935+ "postcmds": True}
4936+ }
4937
4938 def __init__(self, name, cfg, paths):
4939 distros.Distro.__init__(self, name, cfg, paths)
4940@@ -63,12 +61,6 @@ class Distro(distros.Distro):
4941 # should only happen say once per instance...)
4942 self._runner = helpers.Runners(paths)
4943 self.osfamily = 'debian'
4944- self._net_renderer = eni.Renderer({
4945- 'eni_path': self.network_conf_fn,
4946- 'eni_header': ENI_HEADER,
4947- 'links_path_prefix': None,
4948- 'netrules_path': None,
4949- })
4950
4951 def apply_locale(self, locale, out_fn=None):
4952 if not out_fn:
4953@@ -88,14 +80,13 @@ class Distro(distros.Distro):
4954 self.package_command('install', pkgs=pkglist)
4955
4956 def _write_network(self, settings):
4957- util.write_file(self.network_conf_fn, settings)
4958+ # this is a legacy method, it will always write eni
4959+ util.write_file(self.network_conf_fn["eni"], settings)
4960 return ['all']
4961
4962 def _write_network_config(self, netconfig):
4963- ns = parse_net_config_data(netconfig)
4964- self._net_renderer.render_network_state("/", ns)
4965 _maybe_remove_legacy_eth0()
4966- return []
4967+ return self._supported_write_network_config(netconfig)
4968
4969 def _bring_up_interfaces(self, device_names):
4970 use_all = False
4971@@ -234,3 +225,5 @@ def _maybe_remove_legacy_eth0(path="/etc/network/interfaces.d/eth0.cfg"):
4972 msg = bmsg + " %s exists, but could not be read." % path
4973
4974 LOG.warn(msg)
4975+
4976+# vi: ts=4 expandtab
4977diff --git a/cloudinit/distros/fedora.py b/cloudinit/distros/fedora.py
4978index c777845..a9490d0 100644
4979--- a/cloudinit/distros/fedora.py
4980+++ b/cloudinit/distros/fedora.py
4981@@ -1,24 +1,12 @@
4982-# vi: ts=4 expandtab
4983-#
4984-# Copyright (C) 2012 Canonical Ltd.
4985-# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4986-# Copyright (C) 2012 Yahoo! Inc.
4987-#
4988-# Author: Scott Moser <scott.moser@canonical.com>
4989-# Author: Juerg Haefliger <juerg.haefliger@hp.com>
4990-# Author: Joshua Harlow <harlowja@yahoo-inc.com>
4991+# Copyright (C) 2012 Canonical Ltd.
4992+# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4993+# Copyright (C) 2012 Yahoo! Inc.
4994 #
4995-# This program is free software: you can redistribute it and/or modify
4996-# it under the terms of the GNU General Public License version 3, as
4997-# published by the Free Software Foundation.
4998+# Author: Scott Moser <scott.moser@canonical.com>
4999+# Author: Juerg Haefliger <juerg.haefliger@hp.com>
5000+# Author: Joshua Harlow <harlowja@yahoo-inc.com>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: