From f12df1d21bd4711ef21116ec7182b794e3153cf9 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 12 Feb 2021 07:58:30 +0100 Subject: [PATCH] Change type str -> path in argspec. (#1741) --- changelogs/fragments/1741-use-path-argspec.yml | 4 ++++ plugins/doc_fragments/oracle.py | 2 +- plugins/module_utils/oracle/oci_utils.py | 2 +- plugins/modules/cloud/lxd/lxd_container.py | 8 ++++---- plugins/modules/cloud/lxd/lxd_profile.py | 8 ++++---- 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/1741-use-path-argspec.yml diff --git a/changelogs/fragments/1741-use-path-argspec.yml b/changelogs/fragments/1741-use-path-argspec.yml new file mode 100644 index 0000000000..ed05fee16a --- /dev/null +++ b/changelogs/fragments/1741-use-path-argspec.yml @@ -0,0 +1,4 @@ +minor_changes: +- "oci_vcn - ``api_user_key_file`` is now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741)." +- "lxd_container - ``client_key`` and ``client_cert`` are now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741)." +- "lxd_profile - ``client_key`` and ``client_cert`` are now of type ``path`` and no longer ``str``. A side effect is that certain expansions are made, like ``~`` is replaced by the user's home directory, and environment variables like ``$HOME`` or ``$TEMP`` are evaluated (https://github.com/ansible-collections/community.general/pull/1741)." diff --git a/plugins/doc_fragments/oracle.py b/plugins/doc_fragments/oracle.py index 776c8f52f1..5ad04a2220 100644 --- a/plugins/doc_fragments/oracle.py +++ b/plugins/doc_fragments/oracle.py @@ -47,7 +47,7 @@ class ModuleDocFragment(object): OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See C(config_file_location)). If the key is encrypted with a pass-phrase, the C(api_user_key_pass_phrase) option must also be provided. - type: str + type: path api_user_key_pass_phrase: description: - Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then diff --git a/plugins/module_utils/oracle/oci_utils.py b/plugins/module_utils/oracle/oci_utils.py index 72a872fcb3..973d68845e 100644 --- a/plugins/module_utils/oracle/oci_utils.py +++ b/plugins/module_utils/oracle/oci_utils.py @@ -90,7 +90,7 @@ def get_common_arg_spec(supports_create=False, supports_wait=False): config_profile_name=dict(type="str", default="DEFAULT"), api_user=dict(type="str"), api_user_fingerprint=dict(type="str", no_log=True), - api_user_key_file=dict(type="str"), + api_user_key_file=dict(type="path"), api_user_key_pass_phrase=dict(type="str", no_log=True), auth_type=dict( type="str", diff --git a/plugins/modules/cloud/lxd/lxd_container.py b/plugins/modules/cloud/lxd/lxd_container.py index 119387f97b..1e73c5cf12 100644 --- a/plugins/modules/cloud/lxd/lxd_container.py +++ b/plugins/modules/cloud/lxd/lxd_container.py @@ -132,14 +132,14 @@ options: - If not specified, it defaults to C(${HOME}/.config/lxc/client.key). required: false aliases: [ key_file ] - type: str + type: path client_cert: description: - The client certificate file path. - If not specified, it defaults to C(${HOME}/.config/lxc/client.crt). required: false aliases: [ cert_file ] - type: str + type: path trust_password: description: - The client trusted password. @@ -690,11 +690,11 @@ def main(): default='unix:/var/snap/lxd/common/lxd/unix.socket' ), client_key=dict( - type='str', + type='path', aliases=['key_file'] ), client_cert=dict( - type='str', + type='path', aliases=['cert_file'] ), trust_password=dict(type='str', no_log=True) diff --git a/plugins/modules/cloud/lxd/lxd_profile.py b/plugins/modules/cloud/lxd/lxd_profile.py index ccd74d42f9..9a119d26a2 100644 --- a/plugins/modules/cloud/lxd/lxd_profile.py +++ b/plugins/modules/cloud/lxd/lxd_profile.py @@ -79,14 +79,14 @@ options: - If not specified, it defaults to C($HOME/.config/lxc/client.key). required: false aliases: [ key_file ] - type: str + type: path client_cert: description: - The client certificate file path. - If not specified, it defaults to C($HOME/.config/lxc/client.crt). required: false aliases: [ cert_file ] - type: str + type: path trust_password: description: - The client trusted password. @@ -384,11 +384,11 @@ def main(): default='unix:/var/snap/lxd/common/lxd/unix.socket' ), client_key=dict( - type='str', + type='path', aliases=['key_file'] ), client_cert=dict( - type='str', + type='path', aliases=['cert_file'] ), trust_password=dict(type='str', no_log=True)