Skip to content

Commit 0742b3c

Browse files
committed
Address F841 (unused variable).
1 parent 3478863 commit 0742b3c

File tree

89 files changed

+169
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+169
-222
lines changed

plugins/callback/elastic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(self, display):
145145
self.host = socket.gethostname()
146146
try:
147147
self.ip_address = socket.gethostbyname(socket.gethostname())
148-
except Exception as e:
148+
except Exception:
149149
self.ip_address = None
150150
self.user = getpass.getuser()
151151

plugins/callback/logentries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def set_options(self, task_keys=None, var_options=None, direct=None):
254254

255255
try:
256256
self.token = self.get_option("token")
257-
except KeyError as e:
257+
except KeyError:
258258
self._display.warning(
259259
"Logentries token was not provided, this is required for this callback to operate, disabling"
260260
)

plugins/callback/opentelemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(self, display):
210210
self.host = socket.gethostname()
211211
try:
212212
self.ip_address = socket.gethostbyname(socket.gethostname())
213-
except Exception as e:
213+
except Exception:
214214
self.ip_address = None
215215
self.user = getpass.getuser()
216216

plugins/callback/syslog_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def v2_runner_on_unreachable(self, result):
129129
def v2_runner_on_async_failed(self, result):
130130
res = result._result
131131
host = result._host.get_name()
132-
jid = result._result.get("ansible_job_id")
132+
# jid = result._result.get("ansible_job_id")
133133
self.logger.error(
134134
"%s ansible-command: task execution FAILED; host: %s; message: %s",
135135
self.hostname,

plugins/filter/to_prettytable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ def _configure_alignments(table, field_names, column_alignments):
229229
field_names: List of field names to align
230230
column_alignments: Dict of column alignments
231231
"""
232-
valid_alignments = {"left", "center", "right", "l", "c", "r"}
233232

234233
if not isinstance(column_alignments, dict):
235234
return

plugins/inventory/online.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def extract_rpn(self, host_infos):
135135
def _fetch_information(self, url):
136136
try:
137137
response = open_url(url, headers=self.headers)
138-
except Exception as e:
138+
except Exception:
139139
self.display.warning(f"An error happened while fetching: {url}")
140140
return None
141141

plugins/inventory/xen_orchestra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113
if LooseVersion(websocket.__version__) <= LooseVersion("1.0.0"):
114114
raise ImportError
115-
except ImportError as e:
115+
except ImportError:
116116
HAS_WEBSOCKET = False
117117

118118

plugins/lookup/chef_databag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import chef
5050

5151
HAS_CHEF = True
52-
except ImportError as missing_module:
52+
except ImportError:
5353
HAS_CHEF = False
5454

5555

plugins/lookup/consul_kv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
import consul
121121

122122
HAS_CONSUL = True
123-
except ImportError as e:
123+
except ImportError:
124124
HAS_CONSUL = False
125125

126126

plugins/module_utils/btrfs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ def subvolume_get_default(self, filesystem_path):
8686

8787
def subvolume_set_default(self, filesystem_path, subvolume_id):
8888
command = [self.__btrfs, "subvolume", "set-default", str(subvolume_id), to_bytes(filesystem_path)]
89-
result = self.__module.run_command(command, check_rc=True)
89+
self.__module.run_command(command, check_rc=True)
9090

9191
def subvolume_create(self, subvolume_path):
9292
command = [self.__btrfs, "subvolume", "create", to_bytes(subvolume_path)]
93-
result = self.__module.run_command(command, check_rc=True)
93+
self.__module.run_command(command, check_rc=True)
9494

9595
def subvolume_snapshot(self, snapshot_source, snapshot_destination):
9696
command = [self.__btrfs, "subvolume", "snapshot", to_bytes(snapshot_source), to_bytes(snapshot_destination)]
97-
result = self.__module.run_command(command, check_rc=True)
97+
self.__module.run_command(command, check_rc=True)
9898

9999
def subvolume_delete(self, subvolume_path):
100100
command = [self.__btrfs, "subvolume", "delete", to_bytes(subvolume_path)]
101-
result = self.__module.run_command(command, check_rc=True)
101+
self.__module.run_command(command, check_rc=True)
102102

103103

104104
class BtrfsInfoProvider:

0 commit comments

Comments
 (0)