Merge pull request #161388 from nlewo/fix-openstack-metadata-fetcher
openstack-metadata-fetcher: do not fail if no user-data is provided
This commit is contained in:
commit
49fa262cda
1 changed files with 2 additions and 1 deletions
|
@ -15,7 +15,8 @@
|
|||
}
|
||||
|
||||
wget_imds -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
|
||||
(umask 077 && wget_imds -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data)
|
||||
# When no user-data is provided, the OpenStack metadata server doesn't expose the user-data route.
|
||||
(umask 077 && wget_imds -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data || rm -f "$metaDir/user-data")
|
||||
wget_imds -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
|
||||
wget_imds -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue