mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
[PR #11049/396f467b backport][stable-12] Improve Python code: address unused variables (#11058)
Improve Python code: address unused variables (#11049)
* Address F841 (unused variable).
* Reformat.
* Add changelog fragment.
* More cleanup.
* Remove trailing whitespace.
* Readd removed code as a comment with TODO.
(cherry picked from commit 396f467bbb)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -437,7 +437,7 @@ def change_service_permissions(module, auth, service_id, permissions):
|
||||
data = {"action": {"perform": "chmod", "params": {"octet": permissions}}}
|
||||
|
||||
try:
|
||||
status_result = open_url(
|
||||
open_url(
|
||||
f"{auth.url}/service/{service_id!s}/action",
|
||||
method="POST",
|
||||
force_basic_auth=True,
|
||||
@@ -453,7 +453,7 @@ def change_service_owner(module, auth, service_id, owner_id):
|
||||
data = {"action": {"perform": "chown", "params": {"owner_id": owner_id}}}
|
||||
|
||||
try:
|
||||
status_result = open_url(
|
||||
open_url(
|
||||
f"{auth.url}/service/{service_id!s}/action",
|
||||
method="POST",
|
||||
force_basic_auth=True,
|
||||
@@ -469,7 +469,7 @@ def change_service_group(module, auth, service_id, group_id):
|
||||
data = {"action": {"perform": "chgrp", "params": {"group_id": group_id}}}
|
||||
|
||||
try:
|
||||
status_result = open_url(
|
||||
open_url(
|
||||
f"{auth.url}/service/{service_id!s}/action",
|
||||
method="POST",
|
||||
force_basic_auth=True,
|
||||
@@ -666,7 +666,7 @@ def delete_service(module, auth, service_id):
|
||||
return service_info
|
||||
|
||||
try:
|
||||
result = open_url(
|
||||
open_url(
|
||||
f"{auth.url}/service/{service_id!s}",
|
||||
method="DELETE",
|
||||
force_basic_auth=True,
|
||||
|
||||
Reference in New Issue
Block a user