From 876c4ad663043c1c6c0f0ae3034b6f12b2d2e840 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 22 Sep 2023 12:43:56 +0200 Subject: [PATCH] Fix docs Signed-off-by: Alina Buzachis --- plugins/modules/ec2_import_image.py | 19 +++++++++++++++++-- plugins/modules/ec2_import_image_info.py | 7 +------ .../plugins/modules/test_ec2_import_image.py | 2 -- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/plugins/modules/ec2_import_image.py b/plugins/modules/ec2_import_image.py index 51e32d07197..81ea4007a8d 100644 --- a/plugins/modules/ec2_import_image.py +++ b/plugins/modules/ec2_import_image.py @@ -25,6 +25,7 @@ description: - The name of the EC2 image import task. type: str + aliases: ["name"] architecture: description: - The architecture of the virtual machine. @@ -95,10 +96,24 @@ - The ARNs of the license configurations. type: list elements: dict + boot_mode: + description: + - The boot mode of the virtual machine. + type: str + choices: ["legacy-bios", "uefi"] + cancel_reason: + description: + - The reason for canceling the task. + type: str + usage_operation: + description: + - The usage operation value. + type: str tags: description: - The tags to apply to the import image task during creation. type: dict + aliases: ["resource_tags"] author: - Alina Buzachis (@alinabuzachis) extends_documentation_fragment: @@ -239,6 +254,7 @@ role_name: description: - The name of the role to use when not using the default role, 'vmimport'. + type: str tags: description: - The tags to apply to the import image task during creation. @@ -376,7 +392,7 @@ def present(client, module): def main(): argument_spec = dict( - architecture=dict(type="str"), + architecture=dict(type="str", choices=["i386", "x86_64"]), client_data=dict(type="dict"), description=dict(type="str"), disk_containers=dict(type="list", elements="dict"), @@ -386,7 +402,6 @@ def main(): kms_key_id=dict(type="str"), license_type=dict(type="str", no_log=False), tags=dict(required=False, type="dict", aliases=["resource_tags"]), - purge_tags=dict(default=True, type="bool"), platform=dict(type="str", choices=["Windows", "Linux"]), role_name=dict(type="str"), license_specifications=dict(type="list", elements="dict"), diff --git a/plugins/modules/ec2_import_image_info.py b/plugins/modules/ec2_import_image_info.py index 2f66a601643..b94fcf25613 100644 --- a/plugins/modules/ec2_import_image_info.py +++ b/plugins/modules/ec2_import_image_info.py @@ -25,7 +25,6 @@ - See U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImportImageTasks.html) for possible filters. type: list elements: dict - default: [] extends_documentation_fragment: - amazon.aws.common.modules - amazon.aws.region.modules @@ -157,6 +156,7 @@ role_name: description: - The name of the role to use when not using the default role, 'vmimport'. + type: str tags: description: - The tags to apply to the import image task during creation. @@ -165,11 +165,6 @@ import copy -try: - import botocore -except ImportError: - pass # Handled by AnsibleAWSModule - from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry from ansible_collections.amazon.aws.plugins.module_utils.ec2 import helper_describe_import_image_tasks diff --git a/tests/unit/plugins/modules/test_ec2_import_image.py b/tests/unit/plugins/modules/test_ec2_import_image.py index 970e91fca07..b317680560e 100644 --- a/tests/unit/plugins/modules/test_ec2_import_image.py +++ b/tests/unit/plugins/modules/test_ec2_import_image.py @@ -1,11 +1,9 @@ # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -import unittest import pytest from unittest.mock import MagicMock from unittest.mock import patch -from unittest.mock import call from unittest.mock import ANY from ansible_collections.amazon.aws.plugins.modules import ec2_import_image