~dpb/cloud-init/fix-landscape-init-example

Viewing all changes in revision 934.

  • Committer: Scott Moser
  • Author(s): Vlastimil Holer
  • Date: 2014-01-28 19:15:20 UTC
  • mfrom: (933.1.1 cloud-init.ipv4)
  • Revision ID: smoser@ubuntu.com-20140128191520-efpgd3c4p5g3q9hg
util.is_ipv4: realize that 0 is a valid number in a ipv4 address.

Due to bug in function "cloudinit.util.is_ipv4" an IPv4 address with zero (0)
at any component wasn't evaluated as IPv4 address.

E.g.: having local datasource with 192.168.0.1 in meta-data/local-hostname. The
correct behaviour would be to generate ip-192-168-0-1 hostname. With this bug,
the hostname (with IPv4) was considered as FQDN (no IPv4 inside) and just first
component (supposed to be hostname there) was taken. It generated hostname
"192".

Fixes for SmartOS datasource

1. fixed conflation of user-data and cloud-init user-data. Cloud-init
   user-data is now namespaced as 'cloud-init:user-data'.
2. user-scripts (not user-data) are now fetched from the meta-data service
   each boot and executed as in the scripts directory
3. datacenter name is now namespaced as sdc:datacenter
4. user-scripts will now have '#!/bin/bash' magically prepended
   if the 'file' thinks its plain text and it does not start with '#!'


read_file_or_url: raise UrlError with 404 on ENOENT

This makes it easier to call read_file_or_url and handle file or url
errors.  Now read_file_or_url will raise a UrlError in either case
on errors.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: