|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
From 40c52ce1f4049449b04f93226721f63af874c5c7 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
From: Eduardo Dobay <edudobay@users.noreply.github.com>
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
Date: Wed, 6 Apr 2022 01:28:01 -0300
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
Subject: [PATCH] Support EC2 tags in instance metadata (#1309)
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
Add support for newer EC2 metadata versions (up to 2021-03-23), so that
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
tags can be retrieved from the `ds.meta_data.tags` field, as well as
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
with any new fields that might have been added since the 2018-09-24
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
version.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
---
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
cloudinit/sources/DataSourceEc2.py | 5 +++--
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
doc/rtd/topics/datasources/ec2.rst | 28 ++++++++++++++++++++++------
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
tests/unittests/sources/test_ec2.py | 26 +++++++++++++++++++++++++-
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
tools/.github-cla-signers | 1 +
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
4 files changed, 51 insertions(+), 9 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
index 03b3870c2e..a030b4987b 100644
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
--- a/cloudinit/sources/DataSourceEc2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+++ b/cloudinit/sources/DataSourceEc2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -61,8 +61,9 @@ class DataSourceEc2(sources.DataSource):
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
min_metadata_version = "2009-04-04"
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
# Priority ordered list of additional metadata versions which will be tried
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
- # for extended metadata content. IPv6 support comes in 2016-09-02
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
- extended_metadata_versions = ["2018-09-24", "2016-09-02"]
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ # for extended metadata content. IPv6 support comes in 2016-09-02.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ # Tags support comes in 2021-03-23.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ extended_metadata_versions = ["2021-03-23", "2018-09-24", "2016-09-02"]
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
# Setup read_url parameters per get_url_params.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
url_max_wait = 120
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
diff --git a/doc/rtd/topics/datasources/ec2.rst b/doc/rtd/topics/datasources/ec2.rst
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
index 94e4158d93..77232269b9 100644
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
--- a/doc/rtd/topics/datasources/ec2.rst
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+++ b/doc/rtd/topics/datasources/ec2.rst
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -38,11 +38,26 @@ Userdata is accessible via the following URL:
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
GET http://169.254.169.254/2009-04-04/user-data
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
1234,fred,reboot,true | 4512,jimbo, | 173,,,
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
-Note that there are multiple versions of this data provided, cloud-init
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
-by default uses **2009-04-04** but newer versions can be supported with
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
-relative ease (newer versions have more data exposed, while maintaining
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
-backward compatibility with the previous versions).
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
-Version **2016-09-02** is required for secondary IP address support.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+Note that there are multiple EC2 Metadata versions of this data provided
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+to instances. cloud-init will attempt to use the most recent API version it
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+supports in order to get latest API features and instance-data. If a given
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+API version is not exposed to the instance, those API features will be
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+unavailable to the instance.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++----------------+----------------------------------------------------------+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++ EC2 version | supported instance-data/feature |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++================+==========================================================+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++ **2021-03-23** | Required for Instance tag support. This feature must be |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+| | enabled individually on each instance. See the |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+| | `EC2 tags user guide`_. |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++----------------+----------------------------------------------------------+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+| **2016-09-02** | Required for secondary IP address support. |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++----------------+----------------------------------------------------------+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+| **2009-04-04** | Minimum supports EC2 API version for meta-data and |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+| | user-data. |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
++----------------+----------------------------------------------------------+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
To see which versions are supported from your cloud provider use the following
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
URL:
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -71,7 +86,7 @@ configuration (in `/etc/cloud/cloud.cfg` or `/etc/cloud/cloud.cfg.d/`).
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
The settings that may be configured are:
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
- * **metadata_urls**: This list of urls will be searched for an Ec2
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ * **metadata_urls**: This list of urls will be searched for an EC2
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
metadata service. The first entry that successfully returns a 200 response
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
for <url>/<version>/meta-data/instance-id will be selected.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
(default: ['http://169.254.169.254', 'http://instance-data:8773']).
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -121,4 +136,5 @@ Notes
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
For example: the primary NIC will have a DHCP route-metric of 100,
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
the next NIC will be 200.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+.. _EC2 tags user guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#work-with-tags-in-IMDS
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
.. vi: textwidth=79
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
diff --git a/tests/unittests/sources/test_ec2.py b/tests/unittests/sources/test_ec2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
index b376660d3e..7c8a5ea5ef 100644
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
--- a/tests/unittests/sources/test_ec2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+++ b/tests/unittests/sources/test_ec2.py
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -210,6 +210,17 @@
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
M_PATH_NET = "cloudinit.sources.DataSourceEc2.net."
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+TAGS_METADATA_2021_03_23 = {
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ **DEFAULT_METADATA,
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ "tags": {
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ "instance": {
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ "Environment": "production",
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ "Application": "test",
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ "TagWithoutValue": "",
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ },
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
def _register_ssh_keys(rfunc, base_url, keys_data):
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
"""handle ssh key inconsistencies.
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -670,7 +681,7 @@ def test_aws_token_redacted(self):
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
logs_with_redacted = [log for log in all_logs if REDACT_TOK in log]
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
logs_with_token = [log for log in all_logs if "API-TOKEN" in log]
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
self.assertEqual(1, len(logs_with_redacted_ttl))
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
- self.assertEqual(81, len(logs_with_redacted))
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertEqual(83, len(logs_with_redacted))
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
self.assertEqual(0, len(logs_with_token))
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@mock.patch("cloudinit.net.dhcp.maybe_perform_dhcp_discovery")
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -811,6 +822,19 @@ def test_ec2_local_performs_dhcp_on_non_bsd(
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
)
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
self.assertIn("Crawl of metadata service took", self.logs.getvalue())
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ def test_get_instance_tags(self):
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ ds = self._setup_ds(
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ platform_data=self.valid_platform_data,
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ sys_cfg={"datasource": {"Ec2": {"strict_id": False}}},
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ md={"md": TAGS_METADATA_2021_03_23},
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ )
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertTrue(ds.get_data())
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertIn("tags", ds.metadata)
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertIn("instance", ds.metadata["tags"])
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ instance_tags = ds.metadata["tags"]["instance"]
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertEqual(instance_tags["Application"], "test")
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+ self.assertEqual(instance_tags["Environment"], "production")
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
class TestGetSecondaryAddresses(test_helpers.CiTestCase):
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
index a8f2fd55e1..5f05dba907 100644
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
--- a/tools/.github-cla-signers
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+++ b/tools/.github-cla-signers
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
@@ -28,6 +28,7 @@ dermotbradley
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
dhensby
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
eandersson
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
eb3095
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
+edudobay
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
emmanuelthome
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
eslerm
|
|
![](https://seccdn.libravatar.org/avatar/fd810b62950cc276bea6dfd556fddb46f443946a2cb6243830c798dc8682dd7c?s=16&d=retro) |
9796c9 |
esposem
|