[PR #11341/5b5f7e9e backport][stable-12] batch 1 - update Python idiom to 3.7 using pyupgrade (#11349)

batch 1 - update Python idiom to 3.7 using pyupgrade (#11341)

* batch 1 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* add changelog frag

(cherry picked from commit 5b5f7e9e64)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot]
2025-12-30 16:47:11 +01:00
committed by GitHub
parent 41f815be57
commit 2d07481e64
19 changed files with 48 additions and 29 deletions

View File

@@ -197,7 +197,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
data = self.cobbler.get_profiles(self.token)
else:
data = self.cobbler.get_profiles()
except (socket.gaierror, socket.error, xmlrpc_client.ProtocolError):
except (socket.gaierror, OSError, xmlrpc_client.ProtocolError):
self._reload_cache()
else:
self._init_cache()
@@ -221,7 +221,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
data[i] = self.cobbler.get_system_as_rendered(host["name"], self.token)
else:
data[i] = self.cobbler.get_system_as_rendered(host["name"])
except (socket.gaierror, socket.error, xmlrpc_client.ProtocolError):
except (socket.gaierror, OSError, xmlrpc_client.ProtocolError):
self._reload_cache()
else:
self._init_cache()