Skip to content

Commit 0670a19

Browse files
committed
sq-poller: varius fixes on Node log messages
Signed-off-by: Claudio Lorina <[email protected]>
1 parent 8433ee3 commit 0670a19

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

suzieq/poller/worker/nodes/node.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ async def initialize(self, **kwargs) -> TNode:
146146
passphrase)
147147
if not self.jump_host_key:
148148
raise SqPollerConfError('Unable to read private key file'
149-
f' at {pvtkey_file}'
150-
)
149+
f' at {pvtkey_file}')
151150
else:
152151
self.jump_host = None
153152
self.jump_host_key = None
@@ -849,7 +848,6 @@ async def _exec_cmd(self, service_callback, cmd_list, cb_token,
849848
if only_one is True, commands are executed until the first one that
850849
succeeds, and the rest are ignored.
851850
'''
852-
853851
if self.transport == "ssh":
854852
await self._ssh_gather(service_callback, cmd_list, cb_token,
855853
oformat, timeout, only_one)
@@ -1229,7 +1227,7 @@ async def _rest_gather(self, service_callback, cmd_list, cb_token,
12291227
result.append(self._create_error(cmd))
12301228
self.logger.error(
12311229
f"{self.transport}://{self.hostname}:{self.port}: Unable "
1232-
"to communicate with node due to str(e)")
1230+
f"to communicate with node due to {str(e)}")
12331231

12341232
await service_callback(result, cb_token)
12351233

@@ -1340,8 +1338,8 @@ async def _init_rest(self):
13401338
except Exception as e:
13411339
self.current_exception = e
13421340
self.logger.error(
1343-
"{self.transport}://{self.hostname}:{self.port}: Unable to"
1344-
" communicate with node due to {str(e)}")
1341+
f"{self.transport}://{self.hostname}:{self.port}: Unable "
1342+
f"to communicate with node due to {str(e)}")
13451343

13461344
async def _rest_gather(self, service_callback, cmd_list, cb_token,
13471345
oformat='json', timeout=None):
@@ -1381,8 +1379,8 @@ async def _rest_gather(self, service_callback, cmd_list, cb_token,
13811379
self.current_exception = e
13821380
result.append(self._create_error(cmd_list))
13831381
self.logger.error(
1384-
"{self.transport}://{self.hostname}:{self.port}: Unable "
1385-
"to communicate with node due to {str(e)}")
1382+
f"{self.transport}://{self.hostname}:{self.port}: Unable "
1383+
f"to communicate with node due to {str(e)}")
13861384

13871385
await service_callback(result, cb_token)
13881386

@@ -1709,10 +1707,10 @@ async def _ssh_gather(self, service_callback, cmd_list, cb_token, oformat,
17091707
await self._close_connection()
17101708
self.logger.debug("Closed conn successfully for "
17111709
f"{self.hostname}")
1712-
except Exception as e1:
1710+
except Exception as close_exc:
17131711
self.logger.error(
17141712
f"Caught an exception closing {self.hostname}"
1715-
f" for {cmd}: {e1}")
1713+
f" for {cmd}: {close_exc}")
17161714
else:
17171715
self.logger.error(
17181716
f"Unable to connect to {self.hostname} {cmd} "

0 commit comments

Comments
 (0)