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
diff --git a/.gitignore b/.gitignore
index 865cac1..3946ec7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ dist
5__pycache__5__pycache__
6.tox6.tox
7.coverage7.coverage
8doc/rtd_html
diff --git a/.pylintrc b/.pylintrc
8new file mode 1006449new file mode 100644
index 0000000..b8cda03
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,39 @@
1[MASTER]
2
3# --go-faster, use multiple processes to speed up Pylint
4jobs=4
5
6
7[MESSAGES CONTROL]
8
9# Errors only
10disable=C, F, I, R, W
11
12
13[REPORTS]
14
15# Set the output format. Available formats are text, parseable, colorized, msvs
16output-format=colorized
17
18# Just the errors please, no full report
19reports=no
20
21
22[TYPECHECK]
23
24# List of module names for which member attributes should not be checked
25# (useful for modules/projects where namespaces are manipulated during runtime
26# and thus existing member attributes cannot be deduced by static analysis. It
27# supports qualified module names, as well as Unix pattern matching.
28ignored-modules=six.moves,pkg_resources
29
30# List of class names for which member attributes should not be checked (useful
31# for classes with dynamically set attributes). This supports the use of
32# qualified names.
33ignored-classes=optparse.Values,thread._local
34
35# List of members which are set dynamically and missed by pylint inference
36# system, and so shouldn't trigger E1101 when accessed. Python regular
37# expressions are accepted.
38generated-members=types,http.client,command_handlers
39
diff --git a/ChangeLog b/ChangeLog
index 71df7ad..80405bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,100 @@
10.7.9:
2 - doc: adjust headers in tests documentation for consistency.
3 - pep8: fix issue found in zesty build with pycodestyle.
4 - integration test: initial commit of integration test framework
5 [Wesley Wiedenmeier]
6 - LICENSE: Allow dual licensing GPL-3 or Apache 2.0 [Jon Grimm]
7 - Fix config order of precedence, putting kernel command line over system.
8 [Wesley Wiedenmeier] (LP: #1582323)
9 - pep8: whitespace fix
10 - Update the list of valid ssh keys. [Michael Felt]
11 - network: add ENI unit test for statically rendered routes.
12 - set_hostname: avoid erroneously appending domain to fqdn
13 [Lars Kellogg-Stedman] (LP: #1647910)
14 - doc: change 'nobootwait' to 'nofail' in docs [Anhad Jai Singh]
15 - Replace an expired bit.ly link in code comment.
16 - user-groups: fix bug when groups was provided as string and had spaces
17 (LP: #1354694)
18 - mounts: use mount -a again to accomplish mounts (LP: #1647708)
19 - CloudSigma: Fix bug where datasource was not loaded in local search.
20 (LP: #1648380)
21 - when adding a user, strip whitespace from group list [Lars Kellogg-Stedman]
22 (LP: #1354694)
23 - fix decoding of utf-8 chars in yaml test
24 - Replace usage of sys_netdev_info with read_sys_net (LP: #1625766)
25 - fix problems found in python2.6 test.
26 - OpenStack: extend physical types to include hyperv, hw_veb, vhost_user.
27 (LP: #1642679)
28 - tests: fix assumptions that expected no eth0 in system. (LP: #1644043)
29 - net/cmdline: Consider ip= or ip6= on command line not only ip=
30 (LP: #1639930)
31 - Just use file logging by default (LP: #1643990)
32 - Improve formatting for ProcessExecutionError [Wesley Wiedenmeier]
33 - flake8: fix trailing white space
34 - Doc: various documentation fixes [Sean Bright]
35 - cloudinit/config/cc_rh_subscription.py: Remove repos before adding
36 [Brent Baude]
37 - packages/redhat: fix rpm spec file.
38 - main: set TZ in environment if not already set. [Ryan Harper]
39 - Azure: No longer rely on walinux agent. (LP: #1538522)
40 - disk_setup: Use sectors as unit when formatting MBR disks with sfdisk.
41 [Daniel Watkins] (LP: #1460715)
42 - Add activate_datasource, for datasource specific code paths. (LP: #1611074)
43 - systemd: cloud-init-local use RequiresMountsFor=/var/lib/cloud
44 (LP: #1642062)
45 - systemd: cloud-init remove After=systemd-networkd-wait-online
46 - systemd: cloud-init-local change Before basic to sysinit
47 - pep8: fix style errors reported by pycodestyle 2.1.0
48 - systemd: drop both Wants and After local-fs.target
49 - systemd: networking service adjustments. (LP: #1636912)
50 - systemd: replace Before=basic.target, dbus.target with sysinit.target
51 (LP: #1629797)
52 - doc: Add documentation on stages of boot.
53 - doc: make the RST files consistently formated and other improvements.
54 - Ec2: fix syntax and tox in previous commit.
55 - Ec2: protect against non-dictionary in block-device-mapping.
56 - doc: fixed example to not overwrite /etc/hosts [Chris Glass]
57 - Doc: fix spelling / typos in ca_certs and scripts_vendor.
58 - pyflakes: fix issue with pyflakes 1.3 found in ubuntu zesty-proposed.
59 - net/cmdline: Further adjustments to ipv6 support [LaMont Jones]
60 (LP: #1621615)
61 - Add coverage dependency to bddeb to fix package build.
62 - doc: improve HACKING.rst file
63 - dmidecode: Allow dmidecode to be used on aarch64 [Robert Schweikert]
64 - AliYun: Add new datasource for Ali-Cloud ECS [kaihuan.pkh]
65 - Add coverage collection to tox unit tests. [Joshua Powers]
66 - cc_users_groups: fix remaing call to ds.normalize_user_groups [Ryan Harper]
67 - disk-config: udev settle after partitioning in gpt format. (LP: #1626243)
68 - unittests: do not read system /etc/cloud/cloud.cfg.d (LP: #1635350)
69 - Add documentation for logging features. [Wesley Wiedenmeier]
70 - Add support for snap create-user on Ubuntu Core images. [Ryan Harper]
71 - Fix sshd restarts for rhel distros. [Jim Gorz]
72 - OpenNebula: replace 'ip' parsing with cloudinit.net usage.
73 - Fix python2.6 things found running in centos 6.
74 - Move user/group functions to new ug_util file
75 - DigitalOcean: enable usage of data source by default.
76 - update Gentoo initscripts to run in the correct order [Matthew Thode]
77 - MAAS: improve the main of datasource to look at kernel cmdline config.
78 - tests: silence the Cheetah UserWarning about NameMapper C version.
79 - systemd: Run cloud-init.service Before dbus.socket not dbus.target
80 [Daniel Watkins] (LP: #1629797)
81 - systemd: run cloud-init.service Before dbus.service (LP: #1629797)
82 - unittests: fix use of mock 2.0 'assert_called' when running make check
83 [Ryan Harper]
84 - Improve module documentation and doc cleanup. [Wesley Wiedenmeier]
85 - lxd: Update network config for LXD 2.3 [Stéphane Graber]
86 - DigitalOcean: use meta-data for network configruation [Ben Howard]
87 - ntp: move to run after apt configuration (LP: #1628337)
88 - Decode unicode types in decode_binary [Robert Schweikert]
89 - systemd: Ensure that cloud-init-local happens before NetworkManager
90 - Allow ephemeral drive to be unpartitioned [Paul Meyer]
91 - subp: add 'update_env' argument
92 - net: support reading ipv6 dhcp config from initramfs [LaMont Jones]
93 (LP: #1621615, #1621507)
94 - Adjust mounts and disk configuration for systemd. (LP: #1611074)
95 - dmidecode: run dmidecode only on i?86 or x86_64 arch. [Robert Schweikert]
96 - systemd: put cloud-init.target After multi-user.target (LP: #1623868)
97
10.7.8:980.7.8:
2 - SmartOS: more improvements for network configuration99 - SmartOS: more improvements for network configuration
3 - add ntp config module [Ryan Harper]100 - add ntp config module [Ryan Harper]
diff --git a/HACKING.rst b/HACKING.rst
index 4072d0f..caee7ac 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -1,13 +1,13 @@
1=====================1*********************
2Hacking on cloud-init2Hacking on cloud-init
3=====================3*********************
44
5This document describes how to contribute changes to cloud-init.5This document describes how to contribute changes to cloud-init.
6It assumes you have a `Launchpad`_ account, and refers to your launchpad user6It assumes you have a `Launchpad`_ account, and refers to your launchpad user
7as ``LP_USER`` throughout.7as ``LP_USER`` throughout.
88
9Do these things once9Do these things once
10--------------------10====================
1111
12* To contribute, you must sign the Canonical `contributor license agreement`_12* To contribute, you must sign the Canonical `contributor license agreement`_
1313
@@ -21,11 +21,12 @@ Do these things once
21 There is more information on Launchpad as a git hosting site in21 There is more information on Launchpad as a git hosting site in
22 `Launchpad git documentation`_.22 `Launchpad git documentation`_.
2323
24* Create a new remote pointing to your personal Launchpad repository24* Create a new remote pointing to your personal Launchpad repository.
25 This is equivalent to 'fork' on github.
2526
26 This is equivalent to 'fork' on github::27 .. code:: sh
2728
28 git remote add LP_USER git+ssh://LP_USER@git.launchpad.net/~LP_USER/cloud-init29 git remote add LP_USER ssh://LP_USER@git.launchpad.net/~LP_USER/cloud-init
29 git push LP_USER master30 git push LP_USER master
3031
31.. _repository: https://git.launchpad.net/cloud-init32.. _repository: https://git.launchpad.net/cloud-init
@@ -34,7 +35,7 @@ Do these things once
34.. _Launchpad git documentation: https://help.launchpad.net/Code/Git35.. _Launchpad git documentation: https://help.launchpad.net/Code/Git
3536
36Do these things for each feature or bug37Do these things for each feature or bug
37---------------------------------------38=======================================
3839
39* Create a new topic branch for your work::40* Create a new topic branch for your work::
4041
diff --git a/LICENSE b/LICENSE
index 94a9ed0..8a23b4d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,674 +1,22 @@
1 GNU GENERAL PUBLIC LICENSE1Copyright 2015 Canonical Ltd.
2 Version 3, 29 June 20072
33This program is free software: you can redistribute it and/or modify it under
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>4the terms of the GNU General Public License version 3, as published by the
5 Everyone is permitted to copy and distribute verbatim copies5Free Software Foundation.
6 of this license document, but changing it is not allowed.6
77This program is distributed in the hope that it will be useful, but WITHOUT
8 Preamble8ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
99SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 The GNU General Public License is a free, copyleft license for10General Public License for more details.
11software and other kinds of works.11
1212You should have received a copy of the GNU General Public License along with
13 The licenses for most software and other practical works are designed13this program. If not, see <http://www.gnu.org/licenses/>
14to take away your freedom to share and change the works. By contrast,14
15the GNU General Public License is intended to guarantee your freedom to15Alternatively, this program may be used under the terms of the Apache License,
16share and change all versions of a program--to make sure it remains free16Version 2.0, in which case the provisions of that license are applicable
17software for all its users. We, the Free Software Foundation, use the17instead of those above. If you wish to allow use of your version of this
18GNU General Public License for most of our software; it applies also to18program under the terms of the Apache License, Version 2.0 only, indicate
19any other work released this way by its authors. You can apply it to19your decision by deleting the provisions above and replace them with the notice
20your programs, too.20and other provisions required by the Apache License, Version 2.0. If you do not
2121delete the provisions above, a recipient may use your version of this file
22 When we speak of free software, we are referring to freedom, not22under the terms of either the GPLv3 or the Apache License, Version 2.0.
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE-Apache2.0 b/LICENSE-Apache2.0
675new file mode 10064423new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE-Apache2.0
@@ -0,0 +1,202 @@
1
2 Apache License
3 Version 2.0, January 2004
4 http://www.apache.org/licenses/
5
6 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
8 1. Definitions.
9
10 "License" shall mean the terms and conditions for use, reproduction,
11 and distribution as defined by Sections 1 through 9 of this document.
12
13 "Licensor" shall mean the copyright owner or entity authorized by
14 the copyright owner that is granting the License.
15
16 "Legal Entity" shall mean the union of the acting entity and all
17 other entities that control, are controlled by, or are under common
18 control with that entity. For the purposes of this definition,
19 "control" means (i) the power, direct or indirect, to cause the
20 direction or management of such entity, whether by contract or
21 otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 outstanding shares, or (iii) beneficial ownership of such entity.
23
24 "You" (or "Your") shall mean an individual or Legal Entity
25 exercising permissions granted by this License.
26
27 "Source" form shall mean the preferred form for making modifications,
28 including but not limited to software source code, documentation
29 source, and configuration files.
30
31 "Object" form shall mean any form resulting from mechanical
32 transformation or translation of a Source form, including but
33 not limited to compiled object code, generated documentation,
34 and conversions to other media types.
35
36 "Work" shall mean the work of authorship, whether in Source or
37 Object form, made available under the License, as indicated by a
38 copyright notice that is included in or attached to the work
39 (an example is provided in the Appendix below).
40
41 "Derivative Works" shall mean any work, whether in Source or Object
42 form, that is based on (or derived from) the Work and for which the
43 editorial revisions, annotations, elaborations, or other modifications
44 represent, as a whole, an original work of authorship. For the purposes
45 of this License, Derivative Works shall not include works that remain
46 separable from, or merely link (or bind by name) to the interfaces of,
47 the Work and Derivative Works thereof.
48
49 "Contribution" shall mean any work of authorship, including
50 the original version of the Work and any modifications or additions
51 to that Work or Derivative Works thereof, that is intentionally
52 submitted to Licensor for inclusion in the Work by the copyright owner
53 or by an individual or Legal Entity authorized to submit on behalf of
54 the copyright owner. For the purposes of this definition, "submitted"
55 means any form of electronic, verbal, or written communication sent
56 to the Licensor or its representatives, including but not limited to
57 communication on electronic mailing lists, source code control systems,
58 and issue tracking systems that are managed by, or on behalf of, the
59 Licensor for the purpose of discussing and improving the Work, but
60 excluding communication that is conspicuously marked or otherwise
61 designated in writing by the copyright owner as "Not a Contribution."
62
63 "Contributor" shall mean Licensor and any individual or Legal Entity
64 on behalf of whom a Contribution has been received by Licensor and
65 subsequently incorporated within the Work.
66
67 2. Grant of Copyright License. Subject to the terms and conditions of
68 this License, each Contributor hereby grants to You a perpetual,
69 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 copyright license to reproduce, prepare Derivative Works of,
71 publicly display, publicly perform, sublicense, and distribute the
72 Work and such Derivative Works in Source or Object form.
73
74 3. Grant of Patent License. Subject to the terms and conditions of
75 this License, each Contributor hereby grants to You a perpetual,
76 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 (except as stated in this section) patent license to make, have made,
78 use, offer to sell, sell, import, and otherwise transfer the Work,
79 where such license applies only to those patent claims licensable
80 by such Contributor that are necessarily infringed by their
81 Contribution(s) alone or by combination of their Contribution(s)
82 with the Work to which such Contribution(s) was submitted. If You
83 institute patent litigation against any entity (including a
84 cross-claim or counterclaim in a lawsuit) alleging that the Work
85 or a Contribution incorporated within the Work constitutes direct
86 or contributory patent infringement, then any patent licenses
87 granted to You under this License for that Work shall terminate
88 as of the date such litigation is filed.
89
90 4. Redistribution. You may reproduce and distribute copies of the
91 Work or Derivative Works thereof in any medium, with or without
92 modifications, and in Source or Object form, provided that You
93 meet the following conditions:
94
95 (a) You must give any other recipients of the Work or
96 Derivative Works a copy of this License; and
97
98 (b) You must cause any modified files to carry prominent notices
99 stating that You changed the files; and
100
101 (c) You must retain, in the Source form of any Derivative Works
102 that You distribute, all copyright, patent, trademark, and
103 attribution notices from the Source form of the Work,
104 excluding those notices that do not pertain to any part of
105 the Derivative Works; and
106
107 (d) If the Work includes a "NOTICE" text file as part of its
108 distribution, then any Derivative Works that You distribute must
109 include a readable copy of the attribution notices contained
110 within such NOTICE file, excluding those notices that do not
111 pertain to any part of the Derivative Works, in at least one
112 of the following places: within a NOTICE text file distributed
113 as part of the Derivative Works; within the Source form or
114 documentation, if provided along with the Derivative Works; or,
115 within a display generated by the Derivative Works, if and
116 wherever such third-party notices normally appear. The contents
117 of the NOTICE file are for informational purposes only and
118 do not modify the License. You may add Your own attribution
119 notices within Derivative Works that You distribute, alongside
120 or as an addendum to the NOTICE text from the Work, provided
121 that such additional attribution notices cannot be construed
122 as modifying the License.
123
124 You may add Your own copyright statement to Your modifications and
125 may provide additional or different license terms and conditions
126 for use, reproduction, or distribution of Your modifications, or
127 for any such Derivative Works as a whole, provided Your use,
128 reproduction, and distribution of the Work otherwise complies with
129 the conditions stated in this License.
130
131 5. Submission of Contributions. Unless You explicitly state otherwise,
132 any Contribution intentionally submitted for inclusion in the Work
133 by You to the Licensor shall be under the terms and conditions of
134 this License, without any additional terms or conditions.
135 Notwithstanding the above, nothing herein shall supersede or modify
136 the terms of any separate license agreement you may have executed
137 with Licensor regarding such Contributions.
138
139 6. Trademarks. This License does not grant permission to use the trade
140 names, trademarks, service marks, or product names of the Licensor,
141 except as required for reasonable and customary use in describing the
142 origin of the Work and reproducing the content of the NOTICE file.
143
144 7. Disclaimer of Warranty. Unless required by applicable law or
145 agreed to in writing, Licensor provides the Work (and each
146 Contributor provides its Contributions) on an "AS IS" BASIS,
147 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 implied, including, without limitation, any warranties or conditions
149 of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 PARTICULAR PURPOSE. You are solely responsible for determining the
151 appropriateness of using or redistributing the Work and assume any
152 risks associated with Your exercise of permissions under this License.
153
154 8. Limitation of Liability. In no event and under no legal theory,
155 whether in tort (including negligence), contract, or otherwise,
156 unless required by applicable law (such as deliberate and grossly
157 negligent acts) or agreed to in writing, shall any Contributor be
158 liable to You for damages, including any direct, indirect, special,
159 incidental, or consequential damages of any character arising as a
160 result of this License or out of the use or inability to use the
161 Work (including but not limited to damages for loss of goodwill,
162 work stoppage, computer failure or malfunction, or any and all
163 other commercial damages or losses), even if such Contributor
164 has been advised of the possibility of such damages.
165
166 9. Accepting Warranty or Additional Liability. While redistributing
167 the Work or Derivative Works thereof, You may choose to offer,
168 and charge a fee for, acceptance of support, warranty, indemnity,
169 or other liability obligations and/or rights consistent with this
170 License. However, in accepting such obligations, You may act only
171 on Your own behalf and on Your sole responsibility, not on behalf
172 of any other Contributor, and only if You agree to indemnify,
173 defend, and hold each Contributor harmless for any liability
174 incurred by, or claims asserted against, such Contributor by reason
175 of your accepting any such warranty or additional liability.
176
177 END OF TERMS AND CONDITIONS
178
179 APPENDIX: How to apply the Apache License to your work.
180
181 To apply the Apache License to your work, attach the following
182 boilerplate notice, with the fields enclosed by brackets "[]"
183 replaced with your own identifying information. (Don't include
184 the brackets!) The text should be enclosed in the appropriate
185 comment syntax for the file format. We also recommend that a
186 file or class name and description of purpose be included on the
187 same "printed page" as the copyright notice for easier
188 identification within third-party archives.
189
190 Copyright [yyyy] [name of copyright owner]
191
192 Licensed under the Apache License, Version 2.0 (the "License");
193 you may not use this file except in compliance with the License.
194 You may obtain a copy of the License at
195
196 http://www.apache.org/licenses/LICENSE-2.0
197
198 Unless required by applicable law or agreed to in writing, software
199 distributed under the License is distributed on an "AS IS" BASIS,
200 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 See the License for the specific language governing permissions and
202 limitations under the License.
diff --git a/LICENSE-GPLv3 b/LICENSE-GPLv3
0new file mode 100644203new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/LICENSE-GPLv3
@@ -0,0 +1,674 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14to take away your freedom to share and change the works. By contrast,
15the GNU General Public License is intended to guarantee your freedom to
16share and change all versions of a program--to make sure it remains free
17software for all its users. We, the Free Software Foundation, use the
18GNU General Public License for most of our software; it applies also to
19any other work released this way by its authors. You can apply it to
20your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/Makefile b/Makefile
index 5d35dcc..5940ed7 100644
--- a/Makefile
+++ b/Makefile
@@ -27,13 +27,16 @@ ifeq ($(distro),)
27 distro = redhat27 distro = redhat
28endif28endif
2929
30READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version)30READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version || \
31 echo read-version-failed)
31CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.version_string())")32CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.version_string())")
3233
3334
34all: check35all: check
3536
36check: check_version pep8 $(pyflakes) test $(yaml)37check: check_version test $(yaml)
38
39style-check: pep8 $(pyflakes)
3740
38pep8:41pep8:
39 @$(CWD)/tools/run-pep842 @$(CWD)/tools/run-pep8
@@ -62,8 +65,8 @@ test: $(unittests)
6265
63check_version:66check_version:
64 @if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \67 @if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \
65 echo "Error: read-version version $(READ_VERSION)" \68 echo "Error: read-version version '$(READ_VERSION)'" \
66 "not equal to code version $(CODE_VERSION)"; exit 2; \69 "not equal to code version '$(CODE_VERSION)'"; exit 2; \
67 else true; fi70 else true; fi
6871
69clean_pyc:72clean_pyc:
@@ -73,7 +76,7 @@ clean: clean_pyc
73 rm -rf /var/log/cloud-init.log /var/lib/cloud/76 rm -rf /var/log/cloud-init.log /var/lib/cloud/
7477
75yaml:78yaml:
76 @$(CWD)/tools/validate-yaml.py $(YAML_FILES)79 @$(PYVER) $(CWD)/tools/validate-yaml.py $(YAML_FILES)
7780
78rpm:81rpm:
79 ./packages/brpm --distro $(distro)82 ./packages/brpm --distro $(distro)
@@ -83,3 +86,4 @@ deb:
8386
84.PHONY: test pyflakes pyflakes3 clean pep8 rpm deb yaml check_version87.PHONY: test pyflakes pyflakes3 clean pep8 rpm deb yaml check_version
85.PHONY: pip-test-requirements pip-requirements clean_pyc unittest unittest388.PHONY: pip-test-requirements pip-requirements clean_pyc unittest unittest3
89.PHONY: style-check
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index da12464..e69de29 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -1,21 +0,0 @@
1# vi: ts=4 expandtab
2#
3# Copyright (C) 2012 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5# Copyright (C) 2012 Yahoo! Inc.
6#
7# Author: Scott Moser <scott.moser@canonical.com>
8# Author: Juerg Haefliger <juerg.haefliger@hp.com>
9# Author: Joshua Harlow <harlowja@yahoo-inc.com>
10#
11# This program is free software: you can redistribute it and/or modify
12# it under the terms of the GNU General Public License version 3, as
13# published by the Free Software Foundation.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/cloudinit/atomic_helper.py b/cloudinit/atomic_helper.py
index a3cfd94..fb2df8d 100644
--- a/cloudinit/atomic_helper.py
+++ b/cloudinit/atomic_helper.py
@@ -1,5 +1,4 @@
1#!/usr/bin/python1# This file is part of cloud-init. See LICENSE file for license information.
2# vi: ts=4 expandtab
32
4import json3import json
5import os4import os
@@ -29,3 +28,5 @@ def write_json(filename, data, mode=_DEF_PERMS):
29 return write_file(28 return write_file(
30 filename, json.dumps(data, indent=1, sort_keys=True) + "\n",29 filename, json.dumps(data, indent=1, sort_keys=True) + "\n",
31 omode="w", mode=mode)30 omode="w", mode=mode)
31
32# vi: ts=4 expandtab
diff --git a/cloudinit/cloud.py b/cloudinit/cloud.py
index 3e6be20..b93a42e 100644
--- a/cloudinit/cloud.py
+++ b/cloudinit/cloud.py
@@ -1,24 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2012 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2012 Canonical Ltd.3# Copyright (C) 2012 Yahoo! Inc.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5# Copyright (C) 2012 Yahoo! Inc.
6#
7# Author: Scott Moser <scott.moser@canonical.com>
8# Author: Juerg Haefliger <juerg.haefliger@hp.com>
9# Author: Joshua Harlow <harlowja@yahoo-inc.com>
10#
11# This program is free software: you can redistribute it and/or modify
12# it under the terms of the GNU General Public License version 3, as
13# published by the Free Software Foundation.
14#4#
15# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
226
23import copy7import copy
24import os8import os
@@ -107,3 +91,5 @@ class Cloud(object):
10791
108 def get_ipath(self, name=None):92 def get_ipath(self, name=None):
109 return self.paths.get_ipath(name)93 return self.paths.get_ipath(name)
94
95# vi: ts=4 expandtab
diff --git a/cloudinit/cmd/__init__.py b/cloudinit/cmd/__init__.py
index da12464..e69de29 100644
--- a/cloudinit/cmd/__init__.py
+++ b/cloudinit/cmd/__init__.py
@@ -1,21 +0,0 @@
1# vi: ts=4 expandtab
2#
3# Copyright (C) 2012 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5# Copyright (C) 2012 Yahoo! Inc.
6#
7# Author: Scott Moser <scott.moser@canonical.com>
8# Author: Juerg Haefliger <juerg.haefliger@hp.com>
9# Author: Joshua Harlow <harlowja@yahoo-inc.com>
10#
11# This program is free software: you can redistribute it and/or modify
12# it under the terms of the GNU General Public License version 3, as
13# published by the Free Software Foundation.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
index 83eb02c..fd22132 100644
--- a/cloudinit/cmd/main.py
+++ b/cloudinit/cmd/main.py
@@ -1,25 +1,14 @@
1#!/usr/bin/python1#!/usr/bin/python
2# vi: ts=4 expandtab
3#
4# Copyright (C) 2012 Canonical Ltd.
5# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
6# Copyright (C) 2012 Yahoo! Inc.
7#
8# Author: Scott Moser <scott.moser@canonical.com>
9# Author: Juerg Haefliger <juerg.haefliger@hp.com>
10# Author: Joshua Harlow <harlowja@yahoo-inc.com>
11#2#
12# This program is free software: you can redistribute it and/or modify3# Copyright (C) 2012 Canonical Ltd.
13# it under the terms of the GNU General Public License version 3, as4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
14# published by the Free Software Foundation.5# Copyright (C) 2012 Yahoo! Inc.
15#6#
16# This program is distributed in the hope that it will be useful,7# Author: Scott Moser <scott.moser@canonical.com>
17# but WITHOUT ANY WARRANTY; without even the implied warranty of8# Author: Juerg Haefliger <juerg.haefliger@hp.com>
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9# Author: Joshua Harlow <harlowja@yahoo-inc.com>
19# GNU General Public License for more details.
20#10#
21# You should have received a copy of the GNU General Public License11# This file is part of cloud-init. See LICENSE file for license information.
22# along with this program. If not, see <http://www.gnu.org/licenses/>.
2312
24import argparse13import argparse
25import json14import json
@@ -37,8 +26,10 @@ from cloudinit import signal_handler
37from cloudinit import sources26from cloudinit import sources
38from cloudinit import stages27from cloudinit import stages
39from cloudinit import templater28from cloudinit import templater
29from cloudinit import url_helper
40from cloudinit import util30from cloudinit import util
41from cloudinit import version31from cloudinit import version
32from cloudinit import warnings
4233
43from cloudinit import reporting34from cloudinit import reporting
44from cloudinit.reporting import events35from cloudinit.reporting import events
@@ -140,23 +131,104 @@ def apply_reporting_cfg(cfg):
140 reporting.update_configuration(cfg.get('reporting'))131 reporting.update_configuration(cfg.get('reporting'))
141132
142133
134def parse_cmdline_url(cmdline, names=('cloud-config-url', 'url')):
135 data = util.keyval_str_to_dict(cmdline)
136 for key in names:
137 if key in data:
138 return key, data[key]
139 raise KeyError("No keys (%s) found in string '%s'" %
140 (cmdline, names))
141
142
143def attempt_cmdline_url(path, network=True, cmdline=None):
144 """Write data from url referenced in command line to path.
145
146 path: a file to write content to if downloaded.
147 network: should network access be assumed.
148 cmdline: the cmdline to parse for cloud-config-url.
149
150 This is used in MAAS datasource, in "ephemeral" (read-only root)
151 environment where the instance netboots to iscsi ro root.
152 and the entity that controls the pxe config has to configure
153 the maas datasource.
154
155 An attempt is made on network urls even in local datasource
156 for case of network set up in initramfs.
157
158 Return value is a tuple of a logger function (logging.DEBUG)
159 and a message indicating what happened.
160 """
161
162 if cmdline is None:
163 cmdline = util.get_cmdline()
164
165 try:
166 cmdline_name, url = parse_cmdline_url(cmdline)
167 except KeyError:
168 return (logging.DEBUG, "No kernel command line url found.")
169
170 path_is_local = url.startswith("file://") or url.startswith("/")
171
172 if path_is_local and os.path.exists(path):
173 if network:
174 m = ("file '%s' existed, possibly from local stage download"
175 " of command line url '%s'. Not re-writing." % (path, url))
176 level = logging.INFO
177 if path_is_local:
178 level = logging.DEBUG
179 else:
180 m = ("file '%s' existed, possibly from previous boot download"
181 " of command line url '%s'. Not re-writing." % (path, url))
182 level = logging.WARN
183
184 return (level, m)
185
186 kwargs = {'url': url, 'timeout': 10, 'retries': 2}
187 if network or path_is_local:
188 level = logging.WARN
189 kwargs['sec_between'] = 1
190 else:
191 level = logging.DEBUG
192 kwargs['sec_between'] = .1
193
194 data = None
195 header = b'#cloud-config'
196 try:
197 resp = util.read_file_or_url(**kwargs)
198 if resp.ok():
199 data = resp.contents
200 if not resp.contents.startswith(header):
201 if cmdline_name == 'cloud-config-url':
202 level = logging.WARN
203 else:
204 level = logging.INFO
205 return (
206 level,
207 "contents of '%s' did not start with %s" % (url, header))
208 else:
209 return (level,
210 "url '%s' returned code %s. Ignoring." % (url, resp.code))
211
212 except url_helper.UrlError as e:
213 return (level, "retrieving url '%s' failed: %s" % (url, e))
214
215 util.write_file(path, data, mode=0o600)
216 return (logging.INFO,
217 "wrote cloud-config data from %s='%s' to %s" %
218 (cmdline_name, url, path))
219
220
143def main_init(name, args):221def main_init(name, args):
144 deps = [sources.DEP_FILESYSTEM, sources.DEP_NETWORK]222 deps = [sources.DEP_FILESYSTEM, sources.DEP_NETWORK]
145 if args.local:223 if args.local:
146 deps = [sources.DEP_FILESYSTEM]224 deps = [sources.DEP_FILESYSTEM]
147225
148 if not args.local:226 early_logs = []
149 # See doc/kernel-cmdline.txt227 early_logs.append(
150 #228 attempt_cmdline_url(
151 # This is used in maas datasource, in "ephemeral" (read-only root)229 path=os.path.join("%s.d" % CLOUD_CONFIG,
152 # environment where the instance netboots to iscsi ro root.230 "91_kernel_cmdline_url.cfg"),
153 # and the entity that controls the pxe config has to configure231 network=not args.local))
154 # the maas datasource.
155 #
156 # Could be used elsewhere, only works on network based (not local).
157 root_name = "%s.d" % (CLOUD_CONFIG)
158 target_fn = os.path.join(root_name, "91_kernel_cmdline_url.cfg")
159 util.read_write_cmdline_url(target_fn)
160232
161 # Cloud-init 'init' stage is broken up into the following sub-stages233 # Cloud-init 'init' stage is broken up into the following sub-stages
162 # 1. Ensure that the init object fetches its config without errors234 # 1. Ensure that the init object fetches its config without errors
@@ -182,12 +254,14 @@ def main_init(name, args):
182 outfmt = None254 outfmt = None
183 errfmt = None255 errfmt = None
184 try:256 try:
185 LOG.debug("Closing stdin")257 early_logs.append((logging.DEBUG, "Closing stdin."))
186 util.close_stdin()258 util.close_stdin()
187 (outfmt, errfmt) = util.fixup_output(init.cfg, name)259 (outfmt, errfmt) = util.fixup_output(init.cfg, name)
188 except Exception:260 except Exception:
189 util.logexc(LOG, "Failed to setup output redirection!")261 msg = "Failed to setup output redirection!"
190 print_exc("Failed to setup output redirection!")262 util.logexc(LOG, msg)
263 print_exc(msg)
264 early_logs.append((logging.WARN, msg))
191 if args.debug:265 if args.debug:
192 # Reset so that all the debug handlers are closed out266 # Reset so that all the debug handlers are closed out
193 LOG.debug(("Logging being reset, this logger may no"267 LOG.debug(("Logging being reset, this logger may no"
@@ -201,6 +275,10 @@ def main_init(name, args):
201 # been redirected and log now configured.275 # been redirected and log now configured.
202 welcome(name, msg=w_msg)276 welcome(name, msg=w_msg)
203277
278 # re-play early log messages before logging was setup
279 for lvl, msg in early_logs:
280 LOG.log(lvl, msg)
281
204 # Stage 3282 # Stage 3
205 try:283 try:
206 init.initialize()284 init.initialize()
@@ -235,8 +313,15 @@ def main_init(name, args):
235 " would allow us to stop early.")313 " would allow us to stop early.")
236 else:314 else:
237 existing = "check"315 existing = "check"
238 if util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False):316 mcfg = util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False)
317 if mcfg:
318 LOG.debug("manual cache clean set from config")
239 existing = "trust"319 existing = "trust"
320 else:
321 mfile = path_helper.get_ipath_cur("manual_clean_marker")
322 if os.path.exists(mfile):
323 LOG.debug("manual cache clean found from marker: %s", mfile)
324 existing = "trust"
240325
241 init.purge_cache()326 init.purge_cache()
242 # Delete the non-net file as well327 # Delete the non-net file as well
@@ -326,10 +411,51 @@ def main_init(name, args):
326 util.logexc(LOG, "Failed to re-adjust output redirection!")411 util.logexc(LOG, "Failed to re-adjust output redirection!")
327 logging.setupLogging(mods.cfg)412 logging.setupLogging(mods.cfg)
328413
414 # give the activated datasource a chance to adjust
415 init.activate_datasource()
416
417 di_report_warn(datasource=init.datasource, cfg=init.cfg)
418
329 # Stage 10419 # Stage 10
330 return (init.datasource, run_module_section(mods, name, name))420 return (init.datasource, run_module_section(mods, name, name))
331421
332422
423def di_report_warn(datasource, cfg):
424 if 'di_report' not in cfg:
425 LOG.debug("no di_report found in config.")
426 return
427
428 dicfg = cfg.get('di_report', {})
429 if not isinstance(dicfg, dict):
430 LOG.warn("di_report config not a dictionary: %s", dicfg)
431 return
432
433 dslist = dicfg.get('datasource_list')
434 if dslist is None:
435 LOG.warn("no 'datasource_list' found in di_report.")
436 return
437 elif not isinstance(dslist, list):
438 LOG.warn("di_report/datasource_list not a list: %s", dslist)
439 return
440
441 # ds.__module__ is like cloudinit.sources.DataSourceName
442 # where Name is the thing that shows up in datasource_list.
443 modname = datasource.__module__.rpartition(".")[2]
444 if modname.startswith(sources.DS_PREFIX):
445 modname = modname[len(sources.DS_PREFIX):]
446 else:
447 LOG.warn("Datasource '%s' came from unexpected module '%s'.",
448 datasource, modname)
449
450 if modname in dslist:
451 LOG.debug("used datasource '%s' from '%s' was in di_report's list: %s",
452 datasource, modname, dslist)
453 return
454
455 warnings.show_warning('dsid_missing_source', cfg,
456 source=modname, dslist=str(dslist))
457
458
333def main_modules(action_name, args):459def main_modules(action_name, args):
334 name = args.mode460 name = args.mode
335 # Cloud-init 'modules' stages are broken up into the following sub-stages461 # Cloud-init 'modules' stages are broken up into the following sub-stages
@@ -554,6 +680,10 @@ def status_wrapper(name, args, data_d=None, link_d=None):
554 return len(v1[mode]['errors'])680 return len(v1[mode]['errors'])
555681
556682
683def main_features(name, args):
684 sys.stdout.write('\n'.join(sorted(version.FEATURES)) + '\n')
685
686
557def main(sysv_args=None):687def main(sysv_args=None):
558 if sysv_args is not None:688 if sysv_args is not None:
559 parser = argparse.ArgumentParser(prog=sysv_args[0])689 parser = argparse.ArgumentParser(prog=sysv_args[0])
@@ -644,6 +774,10 @@ def main(sysv_args=None):
644 ' upon'))774 ' upon'))
645 parser_dhclient.set_defaults(action=('dhclient_hook', dhclient_hook))775 parser_dhclient.set_defaults(action=('dhclient_hook', dhclient_hook))
646776
777 parser_features = subparsers.add_parser('features',
778 help=('list defined features'))
779 parser_features.set_defaults(action=('features', main_features))
780
647 args = parser.parse_args(args=sysv_args)781 args = parser.parse_args(args=sysv_args)
648782
649 try:783 try:
@@ -662,6 +796,7 @@ def main(sysv_args=None):
662 if name in ("modules", "init"):796 if name in ("modules", "init"):
663 functor = status_wrapper797 functor = status_wrapper
664798
799 rname = None
665 report_on = True800 report_on = True
666 if name == "init":801 if name == "init":
667 if args.local:802 if args.local:
@@ -676,10 +811,10 @@ def main(sysv_args=None):
676 rname, rdesc = ("single/%s" % args.name,811 rname, rdesc = ("single/%s" % args.name,
677 "running single module %s" % args.name)812 "running single module %s" % args.name)
678 report_on = args.report813 report_on = args.report
679814 else:
680 elif name == 'dhclient_hook':815 rname = name
681 rname, rdesc = ("dhclient-hook",816 rdesc = "running 'cloud-init %s'" % name
682 "running dhclient-hook module")817 report_on = False
683818
684 args.reporter = events.ReportEventStack(819 args.reporter = events.ReportEventStack(
685 rname, rdesc, reporting_enabled=report_on)820 rname, rdesc, reporting_enabled=report_on)
@@ -691,4 +826,8 @@ def main(sysv_args=None):
691826
692827
693if __name__ == '__main__':828if __name__ == '__main__':
829 if 'TZ' not in os.environ:
830 os.environ['TZ'] = ":/etc/localtime"
694 main(sys.argv)831 main(sys.argv)
832
833# vi: ts=4 expandtab
diff --git a/cloudinit/config/__init__.py b/cloudinit/config/__init__.py
index d57453b..57e2a44 100644
--- a/cloudinit/config/__init__.py
+++ b/cloudinit/config/__init__.py
@@ -1,23 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2008-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2008-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Chuck Short <chuck.short@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 3, as
11# published by the Free Software Foundation.
12#3#
13# This program is distributed in the hope that it will be useful,4# Author: Chuck Short <chuck.short@canonical.com>
14# but WITHOUT ANY WARRANTY; without even the implied warranty of5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#6#
7# This file is part of cloud-init. See LICENSE file for license information.
218
22from cloudinit.settings import (PER_INSTANCE, FREQUENCIES)9from cloudinit.settings import (PER_INSTANCE, FREQUENCIES)
2310
@@ -56,3 +43,5 @@ def fixup_module(mod, def_freq=PER_INSTANCE):
56 if not hasattr(mod, 'osfamilies'):43 if not hasattr(mod, 'osfamilies'):
57 setattr(mod, 'osfamilies', [])44 setattr(mod, 'osfamilies', [])
58 return mod45 return mod
46
47# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index 6145fcd..7f09c91 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Apt Configure10Apt Configure
@@ -199,6 +187,8 @@ The ``source`` key supports variable replacements for the following strings:
199 deb-src $MIRROR $RELEASE main restricted187 deb-src $MIRROR $RELEASE main restricted
200 deb $PRIMARY $RELEASE universe restricted188 deb $PRIMARY $RELEASE universe restricted
201 deb $SECURITY $RELEASE-security multiverse189 deb $SECURITY $RELEASE-security multiverse
190 debconf_selections:
191 set1: the-package the-package/some-flag boolean true
202 conf: |192 conf: |
203 APT {193 APT {
204 Get {194 Get {
@@ -216,9 +206,9 @@ The ``source`` key supports variable replacements for the following strings:
216 keyserver: "keyserverurl"206 keyserver: "keyserverurl"
217 source: "deb http://<url>/ xenial main"207 source: "deb http://<url>/ xenial main"
218 source2:208 source2:
219 source "ppa:<ppa-name>"209 source: "ppa:<ppa-name>"
220 source3:210 source3:
221 source "deb $MIRROR $RELEASE multiverse"211 source: "deb $MIRROR $RELEASE multiverse"
222 key: |212 key: |
223 ------BEGIN PGP PUBLIC KEY BLOCK-------213 ------BEGIN PGP PUBLIC KEY BLOCK-------
224 <key data>214 <key data>
@@ -928,4 +918,4 @@ CONFIG_CLEANERS = {
928 'cloud-init': clean_cloud_init,918 'cloud-init': clean_cloud_init,
929}919}
930920
931# vi: ts=4 expandtab syntax=python921# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_apt_pipelining.py b/cloudinit/config/cc_apt_pipelining.py
index ab9d005..cdf28cd 100644
--- a/cloudinit/config/cc_apt_pipelining.py
+++ b/cloudinit/config/cc_apt_pipelining.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#
3# Copyright (C) 2011 Canonical Ltd.
4#
5# Author: Ben Howard <ben.howard@canonical.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Ben Howard <ben.howard@canonical.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20Apt Pipelining8Apt Pipelining
@@ -80,3 +68,5 @@ def write_apt_snippet(setting, log, f_name):
80 file_contents = APT_PIPE_TPL % (setting)68 file_contents = APT_PIPE_TPL % (setting)
81 util.write_file(f_name, file_contents)69 util.write_file(f_name, file_contents)
82 log.debug("Wrote %s with apt pipeline depth setting %s", f_name, setting)70 log.debug("Wrote %s with apt pipeline depth setting %s", f_name, setting)
71
72# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_bootcmd.py b/cloudinit/config/cc_bootcmd.py
index 22b23f2..604f93b 100644
--- a/cloudinit/config/cc_bootcmd.py
+++ b/cloudinit/config/cc_bootcmd.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2011 Canonical Ltd.
2#2# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2011 Canonical Ltd.
4# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Bootcmd10Bootcmd
@@ -43,7 +31,7 @@ specified either as lists or strings. For invocation details, see ``runcmd``.
4331
44 bootcmd:32 bootcmd:
45 - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts33 - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
46 - [ cloud-nit-per, once, mymkfs, mkfs, /dev/vdb ]34 - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
47"""35"""
4836
49import os37import os
@@ -80,3 +68,5 @@ def handle(name, cfg, cloud, log, _args):
80 except Exception:68 except Exception:
81 util.logexc(log, "Failed to run bootcmd module %s", name)69 util.logexc(log, "Failed to run bootcmd module %s", name)
82 raise70 raise
71
72# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_byobu.py b/cloudinit/config/cc_byobu.py
index 4a616e2..8570da1 100755
--- a/cloudinit/config/cc_byobu.py
+++ b/cloudinit/config/cc_byobu.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Byobu10Byobu
@@ -106,3 +94,5 @@ def handle(name, cfg, cloud, log, args):
106 cmd = ["/bin/sh", "-c", "%s %s %s" % ("X=0;", shcmd, "exit $X")]94 cmd = ["/bin/sh", "-c", "%s %s %s" % ("X=0;", shcmd, "exit $X")]
107 log.debug("Setting byobu to %s", value)95 log.debug("Setting byobu to %s", value)
108 util.subp(cmd, capture=False)96 util.subp(cmd, capture=False)
97
98# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_ca_certs.py b/cloudinit/config/cc_ca_certs.py
index 53d1406..64bc900 100644
--- a/cloudinit/config/cc_ca_certs.py
+++ b/cloudinit/config/cc_ca_certs.py
@@ -1,18 +1,6 @@
1# vi: ts=4 expandtab1# Author: Mike Milner <mike.milner@canonical.com>
2#
3# Author: Mike Milner <mike.milner@canonical.com>
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 3, as
7# published by the Free Software Foundation.
8#2#
9# This program is distributed in the hope that it will be useful,3# This file is part of cloud-init. See LICENSE file for license information.
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
164
17"""5"""
18CA Certs6CA Certs
@@ -32,7 +20,7 @@ can be removed from the system with the configuration option
3220
33**Module frequency:** per instance21**Module frequency:** per instance
3422
35**Supporte distros:** ubuntu, debian23**Supported distros:** ubuntu, debian
3624
37**Config keys**::25**Config keys**::
3826
@@ -82,8 +70,8 @@ def add_ca_certs(certs):
82 # We have to strip the content because blank lines in the file70 # We have to strip the content because blank lines in the file
83 # causes subsequent entries to be ignored. (LP: #1077020)71 # causes subsequent entries to be ignored. (LP: #1077020)
84 orig = util.load_file(CA_CERT_CONFIG)72 orig = util.load_file(CA_CERT_CONFIG)
85 cur_cont = '\n'.join([l for l in orig.splitlines()73 cur_cont = '\n'.join([line for line in orig.splitlines()
86 if l != CA_CERT_FILENAME])74 if line != CA_CERT_FILENAME])
87 out = "%s\n%s\n" % (cur_cont.rstrip(), CA_CERT_FILENAME)75 out = "%s\n%s\n" % (cur_cont.rstrip(), CA_CERT_FILENAME)
88 util.write_file(CA_CERT_CONFIG, out, omode="wb")76 util.write_file(CA_CERT_CONFIG, out, omode="wb")
8977
@@ -134,3 +122,5 @@ def handle(name, cfg, _cloud, log, _args):
134 # Update the system with the new cert configuration.122 # Update the system with the new cert configuration.
135 log.debug("Updating certificates")123 log.debug("Updating certificates")
136 update_ca_certs()124 update_ca_certs()
125
126# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
index 922fb6a..2be2532 100644
--- a/cloudinit/config/cc_chef.py
+++ b/cloudinit/config/cc_chef.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
2#
3# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
4#
5# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
6# Author: Mike Moulton <mike@meltmedia.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#2#
9# This program is free software: you can redistribute it and/or modify3# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
10# it under the terms of the GNU General Public License version 3, as4# Author: Mike Moulton <mike@meltmedia.com>
11# published by the Free Software Foundation.5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Chef10Chef
@@ -314,7 +302,7 @@ def install_chef(cloud, chef_cfg, log):
314 retries = max(0, util.get_cfg_option_int(chef_cfg,302 retries = max(0, util.get_cfg_option_int(chef_cfg,
315 "omnibus_url_retries",303 "omnibus_url_retries",
316 default=OMNIBUS_URL_RETRIES))304 default=OMNIBUS_URL_RETRIES))
317 content = url_helper.readurl(url=url, retries=retries)305 content = url_helper.readurl(url=url, retries=retries).contents
318 with util.tempdir() as tmpd:306 with util.tempdir() as tmpd:
319 # Use tmpdir over tmpfile to avoid 'text file busy' on execute307 # Use tmpdir over tmpfile to avoid 'text file busy' on execute
320 tmpf = "%s/chef-omnibus-install" % tmpd308 tmpf = "%s/chef-omnibus-install" % tmpd
@@ -348,3 +336,5 @@ def install_chef_from_gems(ruby_version, chef_version, distro):
348 util.subp(['/usr/bin/gem', 'install', 'chef',336 util.subp(['/usr/bin/gem', 'install', 'chef',
349 '--no-ri', '--no-rdoc', '--bindir',337 '--no-ri', '--no-rdoc', '--bindir',
350 '/usr/bin', '-q'], capture=False)338 '/usr/bin', '-q'], capture=False)
339
340# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_debug.py b/cloudinit/config/cc_debug.py
index 5ab3646..0a039eb 100644
--- a/cloudinit/config/cc_debug.py
+++ b/cloudinit/config/cc_debug.py
@@ -1,18 +1,6 @@
1# vi: ts=4 expandtab1# Copyright (C) 2013 Yahoo! Inc.
2#
3# Copyright (C) 2013 Yahoo! Inc.
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 3, as
7# published by the Free Software Foundation.
8#2#
9# This program is distributed in the hope that it will be useful,3# This file is part of cloud-init. See LICENSE file for license information.
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
164
17"""5"""
18Debug6Debug
@@ -113,3 +101,5 @@ def handle(name, cfg, cloud, log, args):
113 util.write_file(out_file, "".join(content_to_file), 0o644, "w")101 util.write_file(out_file, "".join(content_to_file), 0o644, "w")
114 else:102 else:
115 util.multi_log("".join(content_to_file), console=True, stderr=False)103 util.multi_log("".join(content_to_file), console=True, stderr=False)
104
105# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_disable_ec2_metadata.py b/cloudinit/config/cc_disable_ec2_metadata.py
index 5c54e6f..c56319b 100644
--- a/cloudinit/config/cc_disable_ec2_metadata.py
+++ b/cloudinit/config/cc_disable_ec2_metadata.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Disable EC2 Metadata10Disable EC2 Metadata
@@ -54,3 +42,5 @@ def handle(name, cfg, _cloud, log, _args):
54 else:42 else:
55 log.debug(("Skipping module named %s,"43 log.debug(("Skipping module named %s,"
56 " disabling the ec2 route not enabled"), name)44 " disabling the ec2 route not enabled"), name)
45
46# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
index 0c4b794..f39f081 100644
--- a/cloudinit/config/cc_disk_setup.py
+++ b/cloudinit/config/cc_disk_setup.py
@@ -1,21 +1,9 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Ben Howard <ben.howard@canonical.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 3, as
10# published by the Free Software Foundation.
11#3#
12# This program is distributed in the hope that it will be useful,4# Author: Ben Howard <ben.howard@canonical.com>
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#5#
17# You should have received a copy of the GNU General Public License6# This file is part of cloud-init. See LICENSE file for license information.
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
197
20"""8"""
21Disk Setup9Disk Setup
@@ -213,7 +201,7 @@ def update_fs_setup_devices(disk_setup, tformer):
213201
214 if part and 'partition' in definition:202 if part and 'partition' in definition:
215 definition['_partition'] = definition['partition']203 definition['_partition'] = definition['partition']
216 definition['partition'] = part204 definition['partition'] = part
217205
218206
219def value_splitter(values, start=None):207def value_splitter(values, start=None):
@@ -436,14 +424,13 @@ def get_dyn_func(*args):
436424
437425
438def get_mbr_hdd_size(device):426def get_mbr_hdd_size(device):
439 size_cmd = [SFDISK_CMD, '--show-size', device]
440 size = None
441 try:427 try:
442 size, _err = util.subp(size_cmd)428 size_in_bytes, _ = util.subp([BLKDEV_CMD, '--getsize64', device])
429 sector_size, _ = util.subp([BLKDEV_CMD, '--getss', device])
443 except Exception as e:430 except Exception as e:
444 raise Exception("Failed to get %s size\n%s" % (device, e))431 raise Exception("Failed to get %s size\n%s" % (device, e))
445432
446 return int(size.strip())433 return int(size_in_bytes) / int(sector_size)
447434
448435
449def get_gpt_hdd_size(device):436def get_gpt_hdd_size(device):
@@ -588,7 +575,7 @@ def get_partition_mbr_layout(size, layout):
588 raise Exception("Partition was incorrectly defined: %s" % part)575 raise Exception("Partition was incorrectly defined: %s" % part)
589 percent, part_type = part576 percent, part_type = part
590577
591 part_size = int((float(size) * (float(percent) / 100)) / 1024)578 part_size = int(float(size) * (float(percent) / 100))
592579
593 if part_num == last_part_num:580 if part_num == last_part_num:
594 part_definition.append(",,%s" % part_type)581 part_definition.append(",,%s" % part_type)
@@ -692,7 +679,7 @@ def exec_mkpart_mbr(device, layout):
692 types, i.e. gpt679 types, i.e. gpt
693 """680 """
694 # Create the partitions681 # Create the partitions
695 prt_cmd = [SFDISK_CMD, "--Linux", "-uM", device]682 prt_cmd = [SFDISK_CMD, "--Linux", "--unit=S", "--force", device]
696 try:683 try:
697 util.subp(prt_cmd, data="%s\n" % layout)684 util.subp(prt_cmd, data="%s\n" % layout)
698 except Exception as e:685 except Exception as e:
@@ -909,7 +896,8 @@ def mkfs(fs_cfg):
909 LOG.debug("Error in device identification handling.")896 LOG.debug("Error in device identification handling.")
910 return897 return
911898
912 LOG.debug("File system %s will be created on %s", label, device)899 LOG.debug("File system type '%s' with label '%s' will be created on %s",
900 fs_type, label, device)
913901
914 # Make sure the device is defined902 # Make sure the device is defined
915 if not device:903 if not device:
@@ -958,3 +946,5 @@ def mkfs(fs_cfg):
958 util.subp(fs_cmd)946 util.subp(fs_cmd)
959 except Exception as e:947 except Exception as e:
960 raise Exception("Failed to exec of '%s':\n%s" % (fs_cmd, e))948 raise Exception("Failed to exec of '%s':\n%s" % (fs_cmd, e))
949
950# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_emit_upstart.py b/cloudinit/config/cc_emit_upstart.py
index a7be635..69dc2d5 100644
--- a/cloudinit/config/cc_emit_upstart.py
+++ b/cloudinit/config/cc_emit_upstart.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Emit Upstart10Emit Upstart
@@ -82,3 +70,5 @@ def handle(name, _cfg, cloud, log, args):
82 except Exception as e:70 except Exception as e:
83 # TODO(harlowja), use log exception from utils??71 # TODO(harlowja), use log exception from utils??
84 log.warn("Emission of upstart event %s failed due to: %s", n, e)72 log.warn("Emission of upstart event %s failed due to: %s", n, e)
73
74# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_fan.py b/cloudinit/config/cc_fan.py
index 6027fdc..f0cda3d 100644
--- a/cloudinit/config/cc_fan.py
+++ b/cloudinit/config/cc_fan.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2015 Canonical Ltd.
2#
3# Copyright (C) 2015 Canonical Ltd.
4#
5# Author: Scott Moser <scott.moser@canonical.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Scott Moser <scott.moser@canonical.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20Fan8Fan
@@ -112,3 +100,5 @@ def handle(name, cfg, cloud, log, args):
112 stop_update_start(100 stop_update_start(
113 service='ubuntu-fan', config_file=mycfg.get('config_path'),101 service='ubuntu-fan', config_file=mycfg.get('config_path'),
114 content=mycfg.get('config'), systemd=distro.uses_systemd())102 content=mycfg.get('config'), systemd=distro.uses_systemd())
103
104# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_final_message.py b/cloudinit/config/cc_final_message.py
index 5e144fd..c61f03d 100644
--- a/cloudinit/config/cc_final_message.py
+++ b/cloudinit/config/cc_final_message.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Final Message10Final Message
@@ -96,3 +84,5 @@ def handle(_name, cfg, cloud, log, args):
9684
97 if cloud.datasource.is_disconnected:85 if cloud.datasource.is_disconnected:
98 log.warn("Used fallback datasource")86 log.warn("Used fallback datasource")
87
88# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_foo.py b/cloudinit/config/cc_foo.py
index ad0e046..924b967 100644
--- a/cloudinit/config/cc_foo.py
+++ b/cloudinit/config/cc_foo.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Foo10Foo
@@ -64,3 +52,5 @@ frequency = PER_INSTANCE
6452
65def handle(name, _cfg, _cloud, log, _args):53def handle(name, _cfg, _cloud, log, _args):
66 log.debug("Hi from module %s", name)54 log.debug("Hi from module %s", name)
55
56# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
index a95e6c8..832bb3f 100644
--- a/cloudinit/config/cc_growpart.py
+++ b/cloudinit/config/cc_growpart.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 3, as
11# published by the Free Software Foundation.
12#3#
13# This program is distributed in the hope that it will be useful,4# Author: Scott Moser <scott.moser@canonical.com>
14# but WITHOUT ANY WARRANTY; without even the implied warranty of5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#6#
18# You should have received a copy of the GNU General Public License7# This file is part of cloud-init. See LICENSE file for license information.
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Growpart10Growpart
@@ -354,4 +342,7 @@ def handle(_name, cfg, _cloud, log, _args):
354 else:342 else:
355 log.debug("'%s' %s: %s" % (entry, action, msg))343 log.debug("'%s' %s: %s" % (entry, action, msg))
356344
345
357RESIZERS = (('growpart', ResizeGrowPart), ('gpart', ResizeGpart))346RESIZERS = (('growpart', ResizeGrowPart), ('gpart', ResizeGpart))
347
348# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_grub_dpkg.py b/cloudinit/config/cc_grub_dpkg.py
index 33ca40a..a323edf 100644
--- a/cloudinit/config/cc_grub_dpkg.py
+++ b/cloudinit/config/cc_grub_dpkg.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Grub Dpkg10Grub Dpkg
@@ -105,3 +93,5 @@ def handle(name, cfg, _cloud, log, _args):
105 util.subp(['debconf-set-selections'], dconf_sel)93 util.subp(['debconf-set-selections'], dconf_sel)
106 except Exception:94 except Exception:
107 util.logexc(log, "Failed to run debconf-set-selections for grub-dpkg")95 util.logexc(log, "Failed to run debconf-set-selections for grub-dpkg")
96
97# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_keys_to_console.py b/cloudinit/config/cc_keys_to_console.py
index d4b2013..efedd4a 100644
--- a/cloudinit/config/cc_keys_to_console.py
+++ b/cloudinit/config/cc_keys_to_console.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Keys to Console10Keys to Console
@@ -84,3 +72,5 @@ def handle(name, cfg, cloud, log, _args):
84 except Exception:72 except Exception:
85 log.warn("Writing keys to the system console failed!")73 log.warn("Writing keys to the system console failed!")
86 raise74 raise
75
76# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_landscape.py b/cloudinit/config/cc_landscape.py
index 11c8451..86b7138 100644
--- a/cloudinit/config/cc_landscape.py
+++ b/cloudinit/config/cc_landscape.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Landscape10Landscape
@@ -146,3 +134,5 @@ def merge_together(objs):
146 else:134 else:
147 cfg.merge(ConfigObj(obj))135 cfg.merge(ConfigObj(obj))
148 return cfg136 return cfg
137
138# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_locale.py b/cloudinit/config/cc_locale.py
index 268888e..f68c3cc 100644
--- a/cloudinit/config/cc_locale.py
+++ b/cloudinit/config/cc_locale.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Locale10Locale
@@ -55,3 +43,5 @@ def handle(name, cfg, cloud, log, args):
55 log.debug("Setting locale to %s", locale)43 log.debug("Setting locale to %s", locale)
56 locale_cfgfile = util.get_cfg_option_str(cfg, "locale_configfile")44 locale_cfgfile = util.get_cfg_option_str(cfg, "locale_configfile")
57 cloud.distro.apply_locale(locale, locale_cfgfile)45 cloud.distro.apply_locale(locale, locale_cfgfile)
46
47# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_lxd.py b/cloudinit/config/cc_lxd.py
index 3e7faca..e6262f8 100644
--- a/cloudinit/config/cc_lxd.py
+++ b/cloudinit/config/cc_lxd.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2016 Canonical Ltd.
2#
3# Copyright (C) 2016 Canonical Ltd.
4#
5# Author: Wesley Wiedenmeier <wesley.wiedenmeier@canonical.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Wesley Wiedenmeier <wesley.wiedenmeier@canonical.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20LXD8LXD
@@ -262,3 +250,5 @@ def bridge_to_cmd(bridge_cfg):
262 cmd_create.append("--force-local")250 cmd_create.append("--force-local")
263251
264 return cmd_create, cmd_attach252 return cmd_create, cmd_attach
253
254# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_mcollective.py b/cloudinit/config/cc_mcollective.py
index c447f26..d5f63f5 100644
--- a/cloudinit/config/cc_mcollective.py
+++ b/cloudinit/config/cc_mcollective.py
@@ -1,23 +1,11 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Marc Cluet <marc.cluet@canonical.com>
7# Based on code by Scott Moser <scott.moser@canonical.com>
8# Author: Juerg Haefliger <juerg.haefliger@hp.com>
9#3#
10# This program is free software: you can redistribute it and/or modify4# Author: Marc Cluet <marc.cluet@canonical.com>
11# it under the terms of the GNU General Public License version 3, as5# Based on code by Scott Moser <scott.moser@canonical.com>
12# published by the Free Software Foundation.6# Author: Juerg Haefliger <juerg.haefliger@hp.com>
13#7#
14# This program is distributed in the hope that it will be useful,8# This file is part of cloud-init. See LICENSE file for license information.
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
219
22"""10"""
23Mcollective11Mcollective
@@ -155,3 +143,5 @@ def handle(name, cfg, cloud, log, _args):
155143
156 # restart mcollective to handle updated config144 # restart mcollective to handle updated config
157 util.subp(['service', 'mcollective', 'restart'], capture=False)145 util.subp(['service', 'mcollective', 'restart'], capture=False)
146
147# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_migrator.py b/cloudinit/config/cc_migrator.py
index 6e0bf4b..3995704 100644
--- a/cloudinit/config/cc_migrator.py
+++ b/cloudinit/config/cc_migrator.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2012 Yahoo! Inc.
2#
3# Copyright (C) 2012 Yahoo! Inc.
4#
5# Author: Joshua Harlow <harlowja@yahoo-inc.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Joshua Harlow <harlowja@yahoo-inc.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20Migrator8Migrator
@@ -105,3 +93,5 @@ def handle(name, cfg, cloud, log, _args):
105 log.debug("Migrated %s semaphore files to there canonicalized names",93 log.debug("Migrated %s semaphore files to there canonicalized names",
106 sems_moved)94 sems_moved)
107 _migrate_legacy_sems(cloud, log)95 _migrate_legacy_sems(cloud, log)
96
97# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index dfc4b59..5b630f8 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 3, as
11# published by the Free Software Foundation.
12#3#
13# This program is distributed in the hope that it will be useful,4# Author: Scott Moser <scott.moser@canonical.com>
14# but WITHOUT ANY WARRANTY; without even the implied warranty of5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#6#
18# You should have received a copy of the GNU General Public License7# This file is part of cloud-init. See LICENSE file for license information.
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Mounts10Mounts
@@ -42,6 +30,14 @@ values. It defaults to::
4230
43 mount_default_fields: [none, none, "auto", "defaults,nobootwait", "0", "2"]31 mount_default_fields: [none, none, "auto", "defaults,nobootwait", "0", "2"]
4432
33On a systemd booted system that default is the mostly equivalent::
34
35 mount_default_fields: [none, none, "auto",
36 "defaults,nofail,x-systemd.requires=cloud-init.service", "0", "2"]
37
38Note that `nobootwait` is an upstart specific boot option that somewhat
39equates to the more standard `nofail`.
40
45Swap files can be configured by setting the path to the swap file to create41Swap files can be configured by setting the path to the swap file to create
46with ``filename``, the size of the swap file with ``size`` maximum size of42with ``filename``, the size of the swap file with ``size`` maximum size of
47the swap file if using an ``size: auto`` with ``maxsize``. By default no43the swap file if using an ``size: auto`` with ``maxsize``. By default no
@@ -58,8 +54,8 @@ swap file is created.
58 mounts:54 mounts:
59 - [ /dev/ephemeral0, /mnt, auto, "defaults,noexec" ]55 - [ /dev/ephemeral0, /mnt, auto, "defaults,noexec" ]
60 - [ sdc, /opt/data ]56 - [ sdc, /opt/data ]
61 - [ xvdh, /opt/data, "auto", "defaults,nobootwait", "0", "0" ]57 - [ xvdh, /opt/data, "auto", "defaults,nofail", "0", "0" ]
62 mount_default_fields: [None, None, "auto", "nefaults,nobootwait", "0", "2"]58 mount_default_fields: [None, None, "auto", "defaults,nofail", "0", "2"]
63 swap:59 swap:
64 filename: <file>60 filename: <file>
65 size: <"auto"/size in bytes>61 size: <"auto"/size in bytes>
@@ -312,7 +308,8 @@ def handle_swapcfg(swapcfg):
312def handle(_name, cfg, cloud, log, _args):308def handle(_name, cfg, cloud, log, _args):
313 # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno309 # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno
314 def_mnt_opts = "defaults,nobootwait"310 def_mnt_opts = "defaults,nobootwait"
315 if cloud.distro.uses_systemd():311 uses_systemd = cloud.distro.uses_systemd()
312 if uses_systemd:
316 def_mnt_opts = "defaults,nofail,x-systemd.requires=cloud-init.service"313 def_mnt_opts = "defaults,nofail,x-systemd.requires=cloud-init.service"
317314
318 defvals = [None, None, "auto", def_mnt_opts, "0", "2"]315 defvals = [None, None, "auto", def_mnt_opts, "0", "2"]
@@ -326,6 +323,8 @@ def handle(_name, cfg, cloud, log, _args):
326 if "mounts" in cfg:323 if "mounts" in cfg:
327 cfgmnt = cfg["mounts"]324 cfgmnt = cfg["mounts"]
328325
326 LOG.debug("mounts configuration is %s", cfgmnt)
327
329 for i in range(len(cfgmnt)):328 for i in range(len(cfgmnt)):
330 # skip something that wasn't a list329 # skip something that wasn't a list
331 if not isinstance(cfgmnt[i], list):330 if not isinstance(cfgmnt[i], list):
@@ -422,32 +421,53 @@ def handle(_name, cfg, cloud, log, _args):
422 cc_lines.append('\t'.join(line))421 cc_lines.append('\t'.join(line))
423422
424 fstab_lines = []423 fstab_lines = []
424 removed = []
425 for line in util.load_file(FSTAB_PATH).splitlines():425 for line in util.load_file(FSTAB_PATH).splitlines():
426 try:426 try:
427 toks = WS.split(line)427 toks = WS.split(line)
428 if toks[3].find(comment) != -1:428 if toks[3].find(comment) != -1:
429 removed.append(line)
429 continue430 continue
430 except Exception:431 except Exception:
431 pass432 pass
432 fstab_lines.append(line)433 fstab_lines.append(line)
433434
435 for d in dirs:
436 try:
437 util.ensure_dir(d)
438 except Exception:
439 util.logexc(log, "Failed to make '%s' config-mount", d)
440
441 sadds = [WS.sub(" ", n) for n in cc_lines]
442 sdrops = [WS.sub(" ", n) for n in removed]
443
444 sops = (["- " + drop for drop in sdrops if drop not in sadds] +
445 ["+ " + add for add in sadds if add not in sdrops])
446
434 fstab_lines.extend(cc_lines)447 fstab_lines.extend(cc_lines)
435 contents = "%s\n" % ('\n'.join(fstab_lines))448 contents = "%s\n" % ('\n'.join(fstab_lines))
436 util.write_file(FSTAB_PATH, contents)449 util.write_file(FSTAB_PATH, contents)
437450
451 activate_cmds = []
438 if needswap:452 if needswap:
439 try:453 activate_cmds.append(["swapon", "-a"])
440 util.subp(("swapon", "-a"))
441 except Exception:
442 util.logexc(log, "Activating swap via 'swapon -a' failed")
443454
444 for d in dirs:455 if len(sops) == 0:
456 log.debug("No changes to /etc/fstab made.")
457 else:
458 log.debug("Changes to fstab: %s", sops)
459 activate_cmds.append(["mount", "-a"])
460 if uses_systemd:
461 activate_cmds.append(["systemctl", "daemon-reload"])
462
463 fmt = "Activating swap and mounts with: %s"
464 for cmd in activate_cmds:
465 fmt = "Activate mounts: %s:" + ' '.join(cmd)
445 try:466 try:
446 util.ensure_dir(d)467 util.subp(cmd)
447 except Exception:468 log.debug(fmt, "PASS")
448 util.logexc(log, "Failed to make '%s' config-mount", d)469 except util.ProcessExecutionError:
470 log.warn(fmt, "FAIL")
471 util.logexc(log, fmt, "FAIL")
449472
450 try:473# vi: ts=4 expandtab
451 util.subp(("mount", "-a"))
452 except util.ProcessExecutionError:
453 util.logexc(log, "Activating mounts via 'mount -a' failed")
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index 7cda317..e33032f 100644
--- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2016 Canonical Ltd.
2#
3# Copyright (C) 2016 Canonical Ltd.
4#
5# Author: Ryan Harper <ryan.harper@canonical.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Ryan Harper <ryan.harper@canonical.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20NTP8NTP
@@ -136,3 +124,5 @@ def write_ntp_config_template(cfg, cloud):
136 "not rendering %s"), NTP_CONF)124 "not rendering %s"), NTP_CONF)
137125
138 templater.render_to_file(template_fn, NTP_CONF, params)126 templater.render_to_file(template_fn, NTP_CONF, params)
127
128# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_package_update_upgrade_install.py b/cloudinit/config/cc_package_update_upgrade_install.py
index 6d71761..17b9101 100644
--- a/cloudinit/config/cc_package_update_upgrade_install.py
+++ b/cloudinit/config/cc_package_update_upgrade_install.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2012 Yahoo! Inc.
2#
3# Copyright (C) 2012 Yahoo! Inc.
4#
5# Author: Joshua Harlow <harlowja@yahoo-inc.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Joshua Harlow <harlowja@yahoo-inc.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20Package Update Upgrade Install8Package Update Upgrade Install
@@ -132,3 +120,5 @@ def handle(_name, cfg, cloud, log, _args):
132 log.warn("%s failed with exceptions, re-raising the last one",120 log.warn("%s failed with exceptions, re-raising the last one",
133 len(errors))121 len(errors))
134 raise errors[-1]122 raise errors[-1]
123
124# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_phone_home.py b/cloudinit/config/cc_phone_home.py
index cb70d39..878069b 100644
--- a/cloudinit/config/cc_phone_home.py
+++ b/cloudinit/config/cc_phone_home.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Phone Home10Phone Home
@@ -154,3 +142,5 @@ def handle(name, cfg, cloud, log, args):
154 except Exception:142 except Exception:
155 util.logexc(log, "Failed to post phone home data to %s in %s tries",143 util.logexc(log, "Failed to post phone home data to %s in %s tries",
156 url, tries)144 url, tries)
145
146# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_power_state_change.py b/cloudinit/config/cc_power_state_change.py
index 61b5416..c1c6fe7 100644
--- a/cloudinit/config/cc_power_state_change.py
+++ b/cloudinit/config/cc_power_state_change.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#
3# Copyright (C) 2011 Canonical Ltd.
4#
5# Author: Scott Moser <scott.moser@canonical.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Scott Moser <scott.moser@canonical.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20Power State Change8Power State Change
@@ -266,3 +254,5 @@ def run_after_pid_gone(pid, pidcmdline, timeout, log, condition, func, args):
266 fatal("Unexpected Exception when checking condition: %s" % e)254 fatal("Unexpected Exception when checking condition: %s" % e)
267255
268 func(*args)256 func(*args)
257
258# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_puppet.py b/cloudinit/config/cc_puppet.py
index bfd630d..dc11561 100644
--- a/cloudinit/config/cc_puppet.py
+++ b/cloudinit/config/cc_puppet.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Puppet10Puppet
@@ -161,3 +149,5 @@ def handle(name, cfg, cloud, log, _args):
161149
162 # Start puppetd150 # Start puppetd
163 util.subp(['service', 'puppet', 'start'], capture=False)151 util.subp(['service', 'puppet', 'start'], capture=False)
152
153# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_resizefs.py b/cloudinit/config/cc_resizefs.py
index 1b91796..e028abf 100644
--- a/cloudinit/config/cc_resizefs.py
+++ b/cloudinit/config/cc_resizefs.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 3, as
11# published by the Free Software Foundation.
12#3#
13# This program is distributed in the hope that it will be useful,4# Author: Scott Moser <scott.moser@canonical.com>
14# but WITHOUT ANY WARRANTY; without even the implied warranty of5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#6#
18# You should have received a copy of the GNU General Public License7# This file is part of cloud-init. See LICENSE file for license information.
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Resizefs10Resizefs
@@ -69,6 +57,7 @@ def _resize_xfs(mount_point, devpth):
69def _resize_ufs(mount_point, devpth):57def _resize_ufs(mount_point, devpth):
70 return ('growfs', devpth)58 return ('growfs', devpth)
7159
60
72# Do not use a dictionary as these commands should be able to be used61# Do not use a dictionary as these commands should be able to be used
73# for multiple filesystem types if possible, e.g. one command for62# for multiple filesystem types if possible, e.g. one command for
74# ext2, ext3 and ext4.63# ext2, ext3 and ext4.
@@ -209,3 +198,5 @@ def do_resize(resize_cmd, log):
209 raise198 raise
210 # TODO(harlowja): Should we add a fsck check after this to make199 # TODO(harlowja): Should we add a fsck check after this to make
211 # sure we didn't corrupt anything?200 # sure we didn't corrupt anything?
201
202# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py
index feea565..9c5cd1f 100644
--- a/cloudinit/config/cc_resolv_conf.py
+++ b/cloudinit/config/cc_resolv_conf.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2013 Craig Tracey
2#2# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2013 Craig Tracey
4# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
5#
6# Author: Craig Tracey <craigtracey@gmail.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Craig Tracey <craigtracey@gmail.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Resolv Conf10Resolv Conf
@@ -123,3 +111,5 @@ def handle(name, cfg, cloud, log, _args):
123111
124 generate_resolv_conf(template_fn=template_fn, params=cfg["resolv_conf"])112 generate_resolv_conf(template_fn=template_fn, params=cfg["resolv_conf"])
125 return113 return
114
115# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py
index d858f65..7f36cf8 100644
--- a/cloudinit/config/cc_rh_subscription.py
+++ b/cloudinit/config/cc_rh_subscription.py
@@ -1,20 +1,8 @@
1# vi: ts=4 expandtab1# Copyright (C) 2015 Red Hat, Inc.
2#
3# Copyright (C) 2015 Red Hat, Inc.
4#
5# Author: Brent Baude <bbaude@redhat.com>
6#2#
7# This program is free software: you can redistribute it and/or modify3# Author: Brent Baude <bbaude@redhat.com>
8# it under the terms of the GNU General Public License version 3, as
9# published by the Free Software Foundation.
10#4#
11# This program is distributed in the hope that it will be useful,5# This file is part of cloud-init. See LICENSE file for license information.
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
186
19"""7"""
20RedHat Subscription8RedHat Subscription
@@ -421,11 +409,12 @@ class SubscriptionManager(object):
421 "because it is not enabled".format(fail))409 "because it is not enabled".format(fail))
422410
423 cmd = ['repos']411 cmd = ['repos']
424 if len(enable_list) > 0:
425 cmd.extend(enable_list)
426 if len(disable_list) > 0:412 if len(disable_list) > 0:
427 cmd.extend(disable_list)413 cmd.extend(disable_list)
428414
415 if len(enable_list) > 0:
416 cmd.extend(enable_list)
417
429 try:418 try:
430 self._sub_man_cli(cmd)419 self._sub_man_cli(cmd)
431 except util.ProcessExecutionError as e:420 except util.ProcessExecutionError as e:
@@ -442,3 +431,5 @@ class SubscriptionManager(object):
442431
443 def is_configured(self):432 def is_configured(self):
444 return bool((self.userid and self.password) or self.activation_key)433 return bool((self.userid and self.password) or self.activation_key)
434
435# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_rightscale_userdata.py b/cloudinit/config/cc_rightscale_userdata.py
index 6cf8c94..4e34c7e 100644
--- a/cloudinit/config/cc_rightscale_userdata.py
+++ b/cloudinit/config/cc_rightscale_userdata.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2011 Canonical Ltd.
2#2# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2011 Canonical Ltd.
4# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
208
21"""9"""
22Rightscale Userdata10Rightscale Userdata
@@ -126,3 +114,5 @@ def handle(name, _cfg, cloud, log, _args):
126 log.warn("%s failed with exceptions, re-raising the last one",114 log.warn("%s failed with exceptions, re-raising the last one",
127 len(captured_excps))115 len(captured_excps))
128 raise captured_excps[-1]116 raise captured_excps[-1]
117
118# vi: ts=4 expandtab
diff --git a/cloudinit/config/cc_rsyslog.py b/cloudinit/config/cc_rsyslog.py
index 1c12e56..5031621 100644
--- a/cloudinit/config/cc_rsyslog.py
+++ b/cloudinit/config/cc_rsyslog.py
@@ -1,22 +1,11 @@
1# vi: ts=4 expandtab syntax=python1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License version 3, as
11# published by the Free Software Foundation.
12#3#
13# This program is distributed in the hope that it will be useful,4# Author: Scott Moser <scott.moser@canonical.com>
14# but WITHOUT ANY WARRANTY; without even the implied warranty of5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#6#
18# You should have received a copy of the GNU General Public License7# This file is part of cloud-init. See LICENSE file for license information.
19# along with this program. If not, see <http://www.gnu.org/licenses/>.8
20"""9"""
21.. _cc_rsyslog:10.. _cc_rsyslog:
2211
@@ -451,3 +440,5 @@ def handle(name, cfg, cloud, log, _args):
451 # This should now use rsyslog if440 # This should now use rsyslog if
452 # the logging was setup to use it...441 # the logging was setup to use it...
453 log.debug("%s configured %s files", name, changes)442 log.debug("%s configured %s files", name, changes)
443
444# vi: ts=4 expandtab syntax=python
diff --git a/cloudinit/config/cc_runcmd.py b/cloudinit/config/cc_runcmd.py
index 23e1e89..dfa8cb3 100644
--- a/cloudinit/config/cc_runcmd.py
+++ b/cloudinit/config/cc_runcmd.py
@@ -1,22 +1,10 @@
1# vi: ts=4 expandtab1# Copyright (C) 2009-2010 Canonical Ltd.
2#2# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
3# Copyright (C) 2009-2010 Canonical Ltd.
4# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
5#
6# Author: Scott Moser <scott.moser@canonical.com>
7# Author: Juerg Haefliger <juerg.haefliger@hp.com>
8#3#
9# This program is free software: you can redistribute it and/or modify4# Author: Scott Moser <scott.moser@canonical.com>
10# it under the terms of the GNU General Public License version 3, as5# Author: Juerg Haefliger <juerg.haefliger@hp.com>
11# published by the Free Software Foundation.
12#6#
13# This program is distributed in the hope that it will be useful,7# This file is part of cloud-init. See LICENSE file for license information.
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19