Merge ~jasonzio/cloud-init:randomSeed into cloud-init:master
Status: | Merged |
---|---|
Approved by: | Dan Watkins |
Approved revision: | 335ec2cdc09995ecbb90e5d1aa5622ea6c6a958e |
Merge reported by: | Server Team CI bot |
Merged at revision: | not available |
Proposed branch: | ~jasonzio/cloud-init:randomSeed |
Merge into: | cloud-init:master |
Diff against target: |
105 lines (+42/-7) 3 files modified
cloudinit/sources/DataSourceAzure.py (+19/-5) tests/data/azure/non_unicode_random_string (+1/-0) tests/unittests/test_datasource/test_azure.py (+22/-2) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dan Watkins | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+365065@code.launchpad.net |
Commit message
Azure: Ensure platform random_seed is always serializable as JSON.
The Azure platform surfaces random bytes into /sys via Hyper-V.
Python 2.7 json.dump() raises an exception if asked to convert
a str with non-character content, and python 3.0 json.dump()
won't serialize a "bytes" value. As a result, c-i instance
data is often not written by Azure, making reboots slower (c-i
has to repeat work).
The random data is base64-encoded and then decoded into a string
(str or unicode depending on the version of Python in use). The
base64 string has just as many bits of entropy, so we're not
throwing away useful "information", but we can be certain
json.dump() will correctly serialize the bits.
FAILED: Continuous integration, rev:87a6981b6ca f9dbe049c6924a1 3d83597bf73c9a /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 650/
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 650/rebuild
https:/