summaryrefslogtreecommitdiff
path: root/setup.py
AgeCommit message (Collapse)Author
2019-04-18setup.py: install bash completion script in new locationDaniel Watkins
Per lintian, this is the path at which bash completion scripts should now be installed.
2019-01-28systemd: Render generator from template to account for system differences.Robert Schweikert
The systemd generator used had a hard coded path for the location target file to create. This path does not apply to all distributions. Make the generator and template to have the path set during build time.
2018-10-09tools: Add cloud-id command line utilityChad Smith
Add a quick cloud lookup utility in order to more easily determine the cloud on which an instance is running. The utility parses standardized attributes from /run/cloud-init/instance-data.json to print the canonical cloud-id for the instance. It uses known region maps if necessary to determine on which specific cloud the instance is running. Examples: aws, aws-gov, aws-china, rackspace, azure-china, lxd, openstack, unknown
2018-05-29util: add get_linux_distro function to replace platform.distRobert Schweikert
Allow the user to set the distribution with --distro argument to setup.py. Fall back is to read /etc/os-release. Final backup is to use platform.dist() Python function. The platform.dist() function is deprecated and will be removed in Python 3.7 LP: #1745235
2018-04-17Implement bash completion script for cloud-init command lineRyan Harper
In bash shells with bash_completion enabled, now the cloud-init sub commands and parameters/flags will be shown.
2017-12-11setup.py: Do not include rendered files in SOURCES.txtScott Moser
cloud-init renders template files during its run of setup.py. Those rendered files were in a temp dir and were making their way into the SOURCES.txt file. That caused problems for SuSE's build system that desired for reproducible builds. https://reproducible-builds.org/ We do not want to include those, so here we explicitly prune them out. The issue of SOURCES.txt containing tmp files was reproducible with: $ rm -Rf cloud_init.egg-info $ git clean --force $ rm -Rf ../root.d; python3 setup.py install --root=../root.d $ grep ^tmp cloud_init.egg-info/SOURCES.txt goo: http://bugzilla.opensuse.org/show_bug.cgi?id=1069635
2017-09-21suse: Copy sysvinit files from redhat with slight changes.Robert Schweikert
Here we commit the SuSE provided sysvinit scripts. They are very similar to those in redhat/ directory. They differ in small but important ways. Rather than build a template system here we will just accept the copy and paste. sysvinit in both RedHat and SuSE is EOL, so we do not expect any real maintenance cost here. LP: #1718649
2017-09-15Do not provide systemd-fsck drop-in which could cause ordering cycles.Balint Reczey
Revert "centos: do not package systemd-fsck drop-in." Revert "systemd: make systemd-fsck run after cloud-init.service" The systemd-fsck drop-in caused regressions by introducing ordering The change reverts the original commit that added systemd-fsck drop-in and another commit that had removed that from the centos packaging: 1f5489c258a26f4e26261c40786537951d67df1e 8a5296c41db45be3a172862f324ad44e732a2250 The result is to no longer provide the systemd-fsck drop-in. LP: #1717477
2017-08-31upstart: do not package upstart jobs, drop ubuntu-init-switch module.Scott Moser
The ubuntu-init-switch module allowed the use to launch an instance that was booted with upstart and have it switch its init system to systemd and then reboot itself. It was only useful for the time period when Ubuntu was transitioning to systemd but only produced images using upstart. Also, do not run setup with --init-system=upstart. This means that by default, debian packages built with packages/bddeb will not have upstart unit files included. No other removal is done here.
2017-07-28cloudinit.net: add initialize_network_device function and testsChad Smith
This is not yet called, but will be called in a subsequent Ec2-related branch to manually initialize a network interface with the responses using dhcp discovery without any dhcp-script side-effects. The functionality has been tested on Ec2 ubuntu and CentOS vms to ensure that network interface initialization works in both OS-types. Since there was poor unit test coverage for the cloudinit.net.__init__ module, this branch adds a bunch of coverage to the functions in cloudinit.net.__init. We can also now have unit tests local to the cloudinit modules. The benefits of having unittests under cloudinit module: - Proximity of unittest to cloudinit module makes it easier for ongoing devs to know where to augment unit tests. The tests.unittest directory is organizated such that it - Allows for 1 to 1 name mapping module -> tests/test_module.py - Improved test and module isolation, if we find unit tests have to import from a number of modules besides the module under test, it will better prompt resturcturing of the module. This also branch touches: - tox.ini to run unit tests found in cloudinit as well as include all test-requirements for pylint since we now have unit tests living within cloudinit package - setup.py to exclude any test modules under cloudinit when packaging
2017-07-25systemd: make systemd-fsck run after cloud-init.serviceScott Moser
cloud-init.service may write filesystems (fs_setup) or re-partition (disk_setup) disks. If systemd-fsck is running on a device while that is occuring then the partitioning or mkfs might fail due to the device being busy. Alternatively, the fsck might fail and cause subsequent mount to fail. LP: #1691489
2017-07-19Templatize systemd unit files for cross distro deltas.Ryan Harper
Under el7, cloud-init systemd files need some unit tweaks to ensure they run at the right time. Pull in current el7 downstream systemd unit changes.
2017-06-08Drop cheetah python module as it is not needed by trunkRyan Harper
Cloud-init's template renderer does not require the use of cheetah (which is python2 only) so do not put it in the list of package requirements.
2017-06-08cloud.cfg: move to a template. setup.py changes along the way.Scott Moser
Here we move the config/cloud.cfg to be rendered as a template. That allows us to maintain deltas between distros in one place. Currently we use 'variant' variable to make decisions. A tools/render-cloudcfg is provided to render the file. There were changes to setup.py, MANIFEST.in to allow us to put all files into a virtual env installation and to render the cloud-config file in 'install' or 'bdist' targets. We have also included some config changes that were found in the redhat distro spec. * include some config changes from the redhat distro spec. The rendered cloud.cfg has some differences. Ubuntu: white space and comment changes only. Freebsd: - whitespace changes and comment changes - datasource_list definition moved to be closer to 'datasource'. - enable modules: migrator, write_files - move package-update-upgrade-install to final. The initial work was done by Josh Harlow.
2017-05-10FreeBSD: improvements and fixes for use on AzureHongjiang Zhang
This patch targets to make FreeBSD 10.3 or 11 work on Azure. The modifications abide by the rule of: * making as less modification as possible * delegate to the distro or datasource where possible. The main modifications are: 1. network configuration improvements, and movement into distro path. 2. Fix setting of password. Password setting through "pw" can only work through pipe. 3. Add 'root:wheel' to syslog_fix_perms field. 4. Support resizing default file system (ufs) 5. copy cloud.cfg for freebsd to /etc/cloud/cloud.cfg rather than /usr/local/etc/cloud/cloud.cfg. 6. Azure specific changes: a. When reading the azure endpoint, search in a different path and read a different option name (option-245 vs. unknown-245). so, the lease file path should be generated according to platform. b. adjust the handling of ephemeral mounts for ufs filesystem and for finding the ephemeral device. c. fix mounting of cdrom LP: #1636345
2017-04-12snap: allows for creating cloud-init snapJoshua Powers
Add a basic snapcraft.yaml file to allow the execution of cloud-init as a snap. This will always pull down the latest source from master for the snap. setup.py will now also set the default init system to be systemd when no other is passed to it.
2017-02-03Add tools/ds-identify to identify datasources available.Scott Moser
ds-identify is run here from the generator. If ds-identify does not see any datasources, it can completely disable cloud-init. The big value in this is that if there is no datasource, no python will ever be loaded, and cloud-init will be disabled.o The default policy being added here is: search,found=all,maybe=all,notfound=disabled That means: - enable (in 'datasource_list') all sources that are found. - if none are found, enable all 'maybe'. - if no maybe are found, then disable cloud-init. On platforms without DMI (everything except for aarch64 and x86), the default 'notfound' setting is 'enabled'. This is because many of the detection mechanisms rely on dmi data, which is present only on x86 and aarch64.
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-08-23add install option for openrcMatthew Thode
Adds an install option for for OpenRC init scripts. I've also restricted installing tests more correctly. Also, don't hardcode the path to ip (/bin/ip on gentoo).
2016-08-15Get Azure endpoint server from DHCP clientBrent Baude
It is more efficient and cross-distribution safe to use the hooks function from dhclient to obtain the Azure endpoint server (DHCP option 245). This is done by providing shell scritps that are called by the hooks infrastructure of both dhclient and NetworkManager. The hooks then invoke 'cloud-init dhclient-hook' that maintains json data with the dhclient options in /run/cloud-init/dhclient.hooks/<interface>.json . The azure helper then pulls the value from /run/cloud-init/dhclient.hooks/<interface>.json file(s). If that file does not exist or the value is not present, it will then fall back to the original method of scraping the dhcp client lease file.
2016-08-05drop modification of version during make-tarball, tools changes.Scott Moser
Modification of the tarball became problematic, as it meant that any tool extracting source would find the orig source tarball different. I found this unusable when trying to use 'gbp buildpackage'. Other changes here are to better support using python3 or python2 for the build. Makefile will try to call the right python version and can be told which python to use. read-version: by adding 'tiny_p' and avoiding the import of cloudinit.util, we need less dependencies to run this.
2016-06-14Make the bin/cloud-init an actual console entrypointJoshua Harlow
This allows for the test_cli test to be more sane.
2016-06-06Rebase against masterJoshua Harlow
2016-05-27remove blocking udev functionalityScott Moser
This didn't really work. See bug for more info. LP: #1577844
2016-05-19Remerge against head/masterJoshua Harlow
2016-05-12fix setup.py for flake8Scott Moser
2016-05-11Fix py26 for rhel (and older versions of python)Joshua Harlow
2016-03-18commit the systemd waiting mechanismScott Moser
Note, still broken as cloud-init local is not going to ever touch the CI_NET_READY file (/run/cloud-init/network-config-ready). So as this is , it will actually just block for 60 seconds and go on.
2016-02-29update setup.py to install generatorScott Moser
2016-02-29setup.py: pep8/flake8 changes onlyScott Moser
2015-07-21Add udev rules for Azure ephemeral disks.Daniel Watkins
And install them in the Debian packaging.
2015-01-21Only install cheetah (and only run the cheetah templating test) when in PythonBarry Warsaw
2. Cheetah is not compatible with Python 3.
2015-01-21* Added a simple tox.ini fileBarry Warsaw
* Use universal_newlines in setup.py so it will work properly in Python 3. * Fix a pyflakes complaint in setup.py * Add a simple MANIFEST.in
2015-01-06tools/run-pep8: remove leading ',' fed to --ignoreScott Moser
--ignore was being called with ',E121,E...' rather than 'E121,E...'. that resulted in odd behavior, missing the pep8 errors that are fixed here.
2014-11-25Update with trunk and resolve conflictsJoshua Harlow
2014-10-29Only use datafiles and initsys addon outside virtualenvsJoshua Harlow
To make it so that cloud-init is installable in a virtualenv where it can be tested in an isolated scenario we need to avoid using and including datafiles (which won't be written into the virtualenv) and also avoid using our initsys helper class which also adds on its own files when we are being ran from a virtualenv.
2014-10-17USR_LIB_EXEC varies depending on systemJoshua Harlow
2014-09-02merge from trunkScott Moser
2014-08-26further remove evidence of pylint.Scott Moser
This just removes comments '# pylint:' things and other code remnents of pylint.
2014-08-23fix: Syntax.Harm Weites
2014-08-22setup.py: remove read_datafiles, use globals for ETC and USRScott Moser
2014-08-16fix: Don't create a directory that will never be used anyway.Harm Weites
2014-08-10change: Install everything in the right location on both Linux (whichHarm Weites
ofcourse already was good) and FreeBSD (which realy likes /usr/local for this).
2014-08-09fix: To install the new freebsd sysvinit scripts, accept a newHarm Weites
sysvinit_freebsd argument. Specifying sysvinit will install the RH scripts, which is wrong.
2014-07-24pep8 fixes (2 unrelated to this mp)Scott Moser
2014-07-24remove print statement from setup.pyScott Moser
2014-07-24Merge systemd instlal paths.Dimitri John Ledkov
2014-07-24refactor redundant systemd_rootDimitri John Ledkov
2014-07-24Use pkg-configDimitri John Ledkov
2014-07-23fix upsDimitri John Ledkov