From 33b9ad09d53910e5aa69bd526ca638363fb1f02b Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Sat, 4 Jan 2025 10:52:09 +1300 Subject: [PATCH] s*: style adjustments (#9517) * s*: style adjustments * fix quotes * Apply suggestions from code review Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- plugins/modules/scaleway_container.py | 4 ++-- plugins/modules/scaleway_container_info.py | 2 +- plugins/modules/scaleway_function.py | 7 ++++--- plugins/modules/scaleway_ip.py | 6 +++--- plugins/modules/scaleway_ip_info.py | 2 +- plugins/modules/scaleway_lb.py | 4 ++-- plugins/modules/sefcontext.py | 19 +++++++++++-------- plugins/modules/sendgrid.py | 9 ++++++--- plugins/modules/sensu_check.py | 11 +++++------ plugins/modules/sensu_client.py | 15 +++++++++------ plugins/modules/sensu_handler.py | 5 +++-- plugins/modules/sensu_silence.py | 3 ++- plugins/modules/sensu_subscription.py | 4 ++-- 13 files changed, 51 insertions(+), 40 deletions(-) diff --git a/plugins/modules/scaleway_container.py b/plugins/modules/scaleway_container.py index 5cdd12da5d..dc4df1c1d5 100644 --- a/plugins/modules/scaleway_container.py +++ b/plugins/modules/scaleway_container.py @@ -108,8 +108,8 @@ options: privacy: description: - Privacy policies define whether a container can be executed anonymously. - - Choose V(public) to enable anonymous execution, or V(private) to protect your container with an authentication mechanism provided by the - Scaleway API. + - Choose V(public) to enable anonymous execution, or V(private) to protect your container with an authentication mechanism + provided by the Scaleway API. type: str default: public choices: diff --git a/plugins/modules/scaleway_container_info.py b/plugins/modules/scaleway_container_info.py index 28cf40ac50..e17547735a 100644 --- a/plugins/modules/scaleway_container_info.py +++ b/plugins/modules/scaleway_container_info.py @@ -66,7 +66,7 @@ container: description: Container used for testing scaleway_container ansible module domain_name: cnansibletestgfogtjod-cn-ansible-test.functions.fnc.fr-par.scw.cloud environment_variables: - MY_VAR: my_value + MY_VAR: my_value error_message: null http_option: "" id: c9070eb0-d7a4-48dd-9af3-4fb139890721 diff --git a/plugins/modules/scaleway_function.py b/plugins/modules/scaleway_function.py index a5e81c37e4..e2142dd1f2 100644 --- a/plugins/modules/scaleway_function.py +++ b/plugins/modules/scaleway_function.py @@ -97,7 +97,8 @@ options: runtime: description: - Runtime of the function. - - See U(https://www.scaleway.com/en/docs/compute/functions/reference-content/functions-lifecycle/) for all available runtimes. + - See U(https://www.scaleway.com/en/docs/compute/functions/reference-content/functions-lifecycle/) for all available + runtimes. type: str required: true @@ -120,8 +121,8 @@ options: privacy: description: - Privacy policies define whether a function can be executed anonymously. - - Choose V(public) to enable anonymous execution, or V(private) to protect your function with an authentication mechanism provided by the - Scaleway API. + - Choose V(public) to enable anonymous execution, or V(private) to protect your function with an authentication mechanism + provided by the Scaleway API. type: str default: public choices: diff --git a/plugins/modules/scaleway_ip.py b/plugins/modules/scaleway_ip.py index 4fad2faf61..2d51478159 100644 --- a/plugins/modules/scaleway_ip.py +++ b/plugins/modules/scaleway_ip.py @@ -61,12 +61,12 @@ options: id: type: str description: - - Id of the Scaleway IP (UUID). + - ID of the Scaleway IP (UUID). server: type: str description: - - Id of the server you want to attach an IP to. - - To unattach an IP don't specify this option. + - ID of the server you want to attach an IP to. + - To unattach an IP do not specify this option. reverse: type: str description: diff --git a/plugins/modules/scaleway_ip_info.py b/plugins/modules/scaleway_ip_info.py index b9475ab58c..7b8e1e6298 100644 --- a/plugins/modules/scaleway_ip_info.py +++ b/plugins/modules/scaleway_ip_info.py @@ -52,7 +52,7 @@ RETURN = r""" scaleway_ip_info: description: - Response from Scaleway API. - - 'For more details please refer to: U(https://developers.scaleway.com/en/products/instance/api/)' + - 'For more details please refer to U(https://developers.scaleway.com/en/products/instance/api/).' returned: success type: list elements: dict diff --git a/plugins/modules/scaleway_lb.py b/plugins/modules/scaleway_lb.py index 7e13c3843f..64a45c73ee 100644 --- a/plugins/modules/scaleway_lb.py +++ b/plugins/modules/scaleway_lb.py @@ -113,7 +113,7 @@ EXAMPLES = r""" region: fr-par """ -RETURNS = ''' +RETURNS = """ { "scaleway_lb": { "backend_count": 0, @@ -154,7 +154,7 @@ RETURNS = ''' ] } } -''' +""" import datetime import time diff --git a/plugins/modules/sefcontext.py b/plugins/modules/sefcontext.py index eeba491f5d..d1023d9d87 100644 --- a/plugins/modules/sefcontext.py +++ b/plugins/modules/sefcontext.py @@ -52,9 +52,10 @@ options: type: str substitute: description: - - Path to use to substitute file context(s) for the specified O(target). The context labeling for the O(target) subtree is made equivalent - to this path. - - This is also referred to as SELinux file context equivalence and it implements the C(equal) functionality of the SELinux management tools. + - Path to use to substitute file context(s) for the specified O(target). The context labeling for the O(target) subtree + is made equivalent to this path. + - This is also referred to as SELinux file context equivalence and it implements the C(equal) functionality of the SELinux + management tools. version_added: 6.4.0 type: str aliases: [equal] @@ -72,7 +73,8 @@ options: state: description: - Whether the SELinux file context must be V(absent) or V(present). - - Specifying V(absent) without either O(setype) or O(substitute) deletes both SELinux type or path substitution mappings that match O(target). + - Specifying V(absent) without either O(setype) or O(substitute) deletes both SELinux type or path substitution mappings + that match O(target). type: str choices: [absent, present] default: present @@ -91,10 +93,11 @@ notes: - The changes are persistent across reboots. - O(setype) and O(substitute) are mutually exclusive. - If O(state=present) then one of O(setype) or O(substitute) is mandatory. - - The M(community.general.sefcontext) module does not modify existing files to the new SELinux context(s), so it is advisable to first create - the SELinux file contexts before creating files, or run C(restorecon) manually for the existing files that require the new SELinux file contexts. - - Not applying SELinux fcontexts to existing files is a deliberate decision as it would be unclear what reported changes would entail to, and - there is no guarantee that applying SELinux fcontext does not pick up other unrelated prior changes. + - The M(community.general.sefcontext) module does not modify existing files to the new SELinux context(s), so it is advisable + to first create the SELinux file contexts before creating files, or run C(restorecon) manually for the existing files + that require the new SELinux file contexts. + - Not applying SELinux fcontexts to existing files is a deliberate decision as it would be unclear what reported changes + would entail to, and there is no guarantee that applying SELinux fcontext does not pick up other unrelated prior changes. requirements: - libselinux-python - policycoreutils-python diff --git a/plugins/modules/sendgrid.py b/plugins/modules/sendgrid.py index e7418af1da..1099f579e1 100644 --- a/plugins/modules/sendgrid.py +++ b/plugins/modules/sendgrid.py @@ -15,9 +15,12 @@ short_description: Sends an email with the SendGrid API description: - Sends an email with a SendGrid account through their API, not through the SMTP service. notes: - - This module is non-idempotent because it sends an email through the external API. It is idempotent only in the case that the module fails. - - Like the other notification modules, this one requires an external dependency to work. In this case, you will need an active SendGrid account. - - In order to use O(api_key), O(cc), O(bcc), O(attachments), O(from_name), O(html_body), and O(headers) you must C(pip install sendgrid). + - This module is non-idempotent because it sends an email through the external API. It is idempotent only in the case that + the module fails. + - Like the other notification modules, this one requires an external dependency to work. In this case, you will need an + active SendGrid account. + - In order to use O(api_key), O(cc), O(bcc), O(attachments), O(from_name), O(html_body), and O(headers) you must C(pip install + sendgrid). requirements: - sendgrid Python library 1.6.22 or lower (Sendgrid API V2 supported) extends_documentation_fragment: diff --git a/plugins/modules/sensu_check.py b/plugins/modules/sensu_check.py index 42ffcf3737..2cac434923 100644 --- a/plugins/modules/sensu_check.py +++ b/plugins/modules/sensu_check.py @@ -15,8 +15,8 @@ short_description: Manage Sensu checks description: - Manage the checks that should be run on a machine by I(Sensu). - Most options do not have a default and will not be added to the check definition unless specified. - - All defaults except O(path), O(state), O(backup) and O(metric) are not managed by this module, - they are simply specified for your convenience. + - All defaults except O(path), O(state), O(backup) and O(metric) are not managed by this module, they are simply specified + for your convenience. deprecated: removed_in: 13.0.0 why: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20. @@ -50,8 +50,8 @@ options: default: /etc/sensu/conf.d/checks.json backup: description: - - Create a backup file (if yes), including the timestamp information so - you can get the original file back if you somehow clobbered it incorrectly. + - Create a backup file (if yes), including the timestamp information so you can get the original file back if you somehow + clobbered it incorrectly. type: bool default: false command: @@ -128,8 +128,7 @@ options: - Number of seconds handlers should wait before taking second action. aggregate: description: - - Classifies the check as an aggregate check, - making it available using the aggregate API. + - Classifies the check as an aggregate check, making it available using the aggregate API. - Default is V(false). type: bool low_flap_threshold: diff --git a/plugins/modules/sensu_client.py b/plugins/modules/sensu_client.py index 50a5c0ae74..955a25f44f 100644 --- a/plugins/modules/sensu_client.py +++ b/plugins/modules/sensu_client.py @@ -14,7 +14,7 @@ author: "David Moreau Simard (@dmsimard)" short_description: Manages Sensu client configuration description: - Manages Sensu client configuration. - - 'For more information, refer to the Sensu documentation: U(https://sensuapp.org/docs/latest/reference/clients.html)' + - 'For more information, refer to the L(Sensu documentation, https://sensuapp.org/docs/latest/reference/clients.html).' deprecated: removed_in: 13.0.0 why: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20. @@ -42,7 +42,8 @@ options: type: str description: - An address to help identify and reach the client. This is only informational, usually an IP address or hostname. - - If not specified it defaults to non-loopback IPv4 address as determined by Ruby Socket.ip_address_list (provided by Sensu). + - If not specified it defaults to non-loopback IPv4 address as determined by Ruby C(Socket.ip_address_list) (provided by + Sensu). subscriptions: type: list elements: str @@ -52,8 +53,8 @@ options: - The subscriptions array items must be strings. safe_mode: description: - - If safe mode is enabled for the client. Safe mode requires local check definitions in order to accept a check request and execute the - check. + - If safe mode is enabled for the client. Safe mode requires local check definitions in order to accept a check request + and execute the check. type: bool default: false redact: @@ -73,7 +74,8 @@ options: keepalive: type: dict description: - - The keepalive definition scope, used to configure Sensu client keepalives behavior (for example keepalive thresholds and so). + - The keepalive definition scope, used to configure Sensu client keepalives behavior (for example keepalive thresholds + and so). registration: type: dict description: @@ -102,7 +104,8 @@ options: servicenow: type: dict description: - - The servicenow definition scope, used to configure the Sensu Enterprise ServiceNow integration (Sensu Enterprise users only). + - The servicenow definition scope, used to configure the Sensu Enterprise ServiceNow integration (Sensu Enterprise users + only). """ EXAMPLES = r""" diff --git a/plugins/modules/sensu_handler.py b/plugins/modules/sensu_handler.py index 995399cd39..ff4a77a6ff 100644 --- a/plugins/modules/sensu_handler.py +++ b/plugins/modules/sensu_handler.py @@ -14,7 +14,7 @@ author: "David Moreau Simard (@dmsimard)" short_description: Manages Sensu handler configuration description: - Manages Sensu handler configuration. - - 'For more information, refer to the Sensu documentation: U(https://sensuapp.org/docs/latest/reference/handlers.html)' + - 'For more information, refer to the L(Sensu documentation, https://sensuapp.org/docs/latest/reference/handlers.html).' deprecated: removed_in: 13.0.0 why: Sensu Core and Sensu Enterprise products have been End of Life since 2019/20. @@ -90,7 +90,8 @@ options: type: dict description: - The socket definition scope, used to configure the TCP/UDP handler socket. - - 'NOTE: the O(socket) attribute is only required for TCP/UDP handlers (that is, handlers configured with O(type=tcp) or O(type=udp)).' + - 'NOTE: the O(socket) attribute is only required for TCP/UDP handlers (that is, handlers configured with O(type=tcp) + or O(type=udp)).' pipe: type: dict description: diff --git a/plugins/modules/sensu_silence.py b/plugins/modules/sensu_silence.py index 1dfc8e1802..a6d699f4c1 100644 --- a/plugins/modules/sensu_silence.py +++ b/plugins/modules/sensu_silence.py @@ -46,7 +46,8 @@ options: reason: type: str description: - - If specified, this free-form string is used to provide context or rationale for the reason this silence entry was created. + - If specified, this free-form string is used to provide context or rationale for the reason this silence entry was + created. state: type: str description: diff --git a/plugins/modules/sensu_subscription.py b/plugins/modules/sensu_subscription.py index cddde2630b..da5c50d42f 100644 --- a/plugins/modules/sensu_subscription.py +++ b/plugins/modules/sensu_subscription.py @@ -46,8 +46,8 @@ options: default: /etc/sensu/conf.d/subscriptions.json backup: description: - - Create a backup file (if yes), including the timestamp information so you - can get the original file back if you somehow clobbered it incorrectly. + - Create a backup file (if yes), including the timestamp information so you can get the original file back if you somehow + clobbered it incorrectly. type: bool required: false default: false