DataSourceEc2: require 'instance-data' as top level domain

In searching for the metadata service, require 'instance-data' to be at the top
level domain.  Previously any misconfigured 'search' in /etc/resolv.conf could
result in unintended use of a metadata server.
This commit is contained in:
Scott Moser 2012-08-27 15:20:58 -04:00
parent 540a79622d
commit 00a696e571
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
0.7.0:
- search only top level dns for 'instance-data' in DataSourceEc2 (LP: #1040200)
- add support for config-drive-v2 (LP:#1037567)
- support creating users, including the default user.
[Ben Howard] (LP: #1028503)

View File

@ -40,7 +40,7 @@ DEF_MD_VERSION = '2009-04-04'
# Default metadata urls that will be used if none are provided
# They will be checked for 'resolveability' and some of the
# following may be discarded if they do not resolve
DEF_MD_URLS = [DEF_MD_URL, "http://instance-data:8773"]
DEF_MD_URLS = [DEF_MD_URL, "http://instance-data.:8773"]
class DataSourceEc2(sources.DataSource):