summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceAzure.py
AgeCommit message (Collapse)Author
2014-08-26fix(pep8): Fix various pep8 violations and version-lock pep8Jay Faulkner
Fixed all complaints from running "make pep8". Also version locked pep8 in test-requirements.txt to ensure that pep8 requirements don't change without an explicit commit.
2014-03-19Azure: pep8 and pylint cleanups from previous commit.Scott Moser
2014-03-19change to unmount then check to address possible raceScott Moser
2014-03-19minor changes: be more careful about umount and warn on failScott Moser
2014-03-18Windows Azure defines the ephemeral0 mount as being a per-boot instead ofBen Howard
per instance. Under a variety of circumstances, the ephemeral device may be presented as a default device. This patch detects when that situation happens and triggers CC modules disk-setup and mounts to run again. Details of changes for cloudinit/sources/DataSourceAzure.py: - auto-detect the location of ephemeral0 - check each boot if ephemeral0 is new - done via NTFS w/ label of "Temporary Storage" w/ no files on it - if device is mounted, datasource will unmount it - if is new, change mounts and disk-setup to always for that boot only
2014-02-10make a defined var of DATA_DIR_CLEAN_LIST, some pylint cleanupsScott Moser
2014-02-10change behavior to only delete SharedConfig.xml.Scott Moser
2014-02-07Made new ovf-env.xml handling more robust. Test cases includedBen Howard
2014-01-15Fix for race condition where 'captured' Windows Azure instances identifyBen Howard
as the previous instance (LP: #1269626).
2014-01-09Azure: minor changes for filename as strings and logging.Scott Moser
We were passing a unicode string to 'runcmd' in the path to the .crt file. That is because the keyname was coming from ovf file as unicode. Ie: u'/var/lib/waagent/6BE7A7C3C8A8F4B123CCA5D0C2F1BE4CA7B63ED7.crt' Then, logging was extending not appending errors.
2013-10-17fix DataSourceAzure incompatibility with 2.6Scott Moser
LP: #1232175
2013-10-03Moved ephemeralX.Y handling from Datasource into the cc_disk_setup, which ↵Ben Howard
makes it cloud agnostic.
2013-10-02Added ability to define disks via 'ephemeralX.Y'.Ben Howard
Modified cc_mounts to identify whether ephermalX is partitioned. Changed datasources for Azure and SmartOS to use 'ephemeralX.Y' format. Added disk remove functionally
2013-09-27azure data source 'ephemeral0' point to '/dev/sdb', not /dev/sdb1Scott Moser
in general block device mappings should be to block devices, not partitoins.
2013-09-27fix tests small other changesScott Moser
Also * cloudinit/sources/DataSourceAzure.py: invalid xml in a file called 'ovfenv.xml' should raise BrokenAzureDatasource rather than NonAzureDataSource * cloudinit/sources/DataSourceSmartOS.py: cloudinit/sources/DataSourceAzure.py use 'ephemeral0' as the device name in builtin fs_setup * tests/unittests/test_datasource/test_azure.py: * always patch 'list_possible_azure_ds_devs' as it calls find_devs_with which calls blkid, and dramatically was slowing down tests on my system. * test_user_cfg_set_agent_command_plain: fix this test to not depend on specific format of yaml.dumps(). * test_userdata_arrives: add a test that user-data makes it through
2013-09-26re-work 'ephemeral_disk' and location of builtin configScott Moser
Previously we had this 'ephemeral_disk' entry in the datasource config for Azure, and then we also copied some entries into the .cfg for that datasource from the datasource config. Ie, datasource['Azure']['disk_setup'] would be oddly copied into the .cfg object that was returned by 'get_config_obj' Now, instead, we have a BUILTIN_CLOUD_CONFIG, which has those same values in it. The other change here is that 'ephemeral_disk' now has no meaning. Instead, we add a populated-by-default entry 'disk_aliases' to the BUILTIN_DS_CFG, and then just return entries in it for 'device_name_to_device'
2013-09-26fix pep8Scott Moser
2013-09-26Added support for formating the ephemeral disk on Windows Azure.Ben Howard
2013-09-09populate random_seed in azure data sourceScott Moser
Azure provides a random bit of data at '/sys/firmware/acpi/tables/OEM0'. The walinux calls this "Entropy in ACPI table provided by Hyper-V".
2013-09-09add support for reading random_seed on azure also.Scott Moser
2013-08-20fix bad arguments to subp inside of apply_hostname_bounceScott Moser
This simply correctly invokes subp through util.log_time. The arguments to subp is named 'args' not 'command'. LP: #1214541
2013-08-15do not set 'password', but set 'passwd' to crypt'd valueScott Moser
'password' was the wrong key. It should have been setting the default user's "plain_text_password". Instead of doing that, though, we're encrypting the value and putting it in 'passwd', which will then be passed on to useradd. The key value in doing this is that the plain text password will not be stored in obj.pkl. (admittedly it is still in plain text in the ovf-env.xml file).
2013-07-30set reading /proc/uptime to false by default.Scott Moser
reading /proc/uptime is going to be slower, and no reason to do it on most things. Better to only do it when you suspect maybe a need for it.
2013-07-30add util.log_time helperScott Moser
The reason for this is that more and more things I was wanting to be able to see how long they took. This puts that time logic into a single place. It also supports (by default) reading from /proc/uptime as the timing mechanism. While that is almost certainly slower than time.time(), it does give millisecond granularity and is not affected by 'ntpdate' having run in between the two events.
2013-07-29DataSourceAzure: do not capture output of bounce commandScott Moser
As shown in comments of bug 1202758 and filing of ntp bug 1206164, waiting for the output of this command causes us to wait for ntpdate to fully finish. Ideally I think we'd disable ntpdate running on this run, but that is not trivially possible.
2013-07-26azure: fix bouncing of interfaceScott Moser
the environment that was set up to include 'interface' was not actually being passed on to 'subp', so when the command ran it wasn't available.
2013-07-25minor azure cleanupScott Moser
2013-07-25azure: support bouncing interfaces to publish new hostnameScott Moser
See the added doc/sources/azure/README.rst for why this is necessary. Essentially, we now are doing the following in the get_data() method of azure datasource to publish this NewHostname: hostname NewHostName ifdown eth0; ifup eth0 LP: #1202758
2013-07-23on azure datasource, grab use Deployment as the instance-idScott Moser
LP: #1204190
2013-07-17Azure: make /var/lib/waagent with 0700 permsScott Moser
The walinux agent expects that the files it writes with 0644 (default umask) permissions are not globally readable. Since we were creating the directory for it, and using default umaks (0755), the files inside were readable to non-priviledged users.
2013-07-17DataSourceAzure: fix inverted logic on DisablesshPasswordAuthenticationBen Howard
DisablesshPasswordAuthentication == True means that ssh_pwauth should be disabled rather than enabled. LP: #1201969
2013-07-16Use the inverse of DisableSshPasswordAuthentication for ssh_pwauth.Ben Howard
(LP: 1201969)
2013-07-11DataSourceAzure.py: allow 'customdata' to be the name for userdataScott Moser
Also, fix a comment and write a log message on how long we waited for the files to appear.
2013-07-10add waiting for files and reading of crt keysScott Moser
2013-07-09build up the 'wait_for' list including fingerprint.crt filesScott Moser
2013-07-09fill out load_azure_ovf_pubkeysScott Moser
now if there are pubkeys, the cfg['_pubkeys'] entry will have a list of dicts where each dict has 'fingerprint' and 'path' entries. The next thing to do is to block waiting for the <fingerprint>.crt files to appear in /var/lib/waagent.
2013-07-09mention using cachedScott Moser
2013-07-09search in the default storage directory for cached ovf-env.xmlScott Moser
since azure ejects the disk on reboot, we need to look there to find this datasource.
2013-07-09populate /var/lib/waagent with ovf-env.xmlScott Moser
this will copy the ovf-env.xml file that was found to the configured directory (default /var/lib/waagent)
2013-07-09better handling for user/passwordScott Moser
2013-07-09add stub for ssh keysScott Moser
The idea is that in the future, the DataSources get_data could check to see if there were ssh keys provided. if there were, it could poll and wait (or inotify) until the <fp>.crt files appeared in the /var/lib/walinux directory. Once they did, it'd populate the metadata's public keys.
2013-07-09add some unit tests, fix things found by doing soScott Moser
2013-07-08commit dev stateScott Moser