summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2024-08-27 12:40:02 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-08-27 12:44:13 +0200
commit3d47b5069a5c6955390ca1bb85a7b194c73049d2 (patch)
tree2fe6ac1a3f9d62e3fe5aef60b99297a758309f8c /src/ogRest.py
parent4b62b80be7a6314ca954539b7ae2a0eac1ad59bd (diff)
src: use logging.warning()
logging.warn() is deprecated since 3.3. And use .error() instead when command is unsupported or client is busy, that should not ever happen.
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index fc46e8d..cab1c06 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -62,7 +62,7 @@ class restResponse():
if response in {ogResponses.OK, ogResponses.IN_PROGRESS}:
logging.debug(self.msg[:ogRest.LOG_LENGTH])
else:
- logging.warn(self.msg[:ogRest.LOG_LENGTH])
+ logging.warning(self.msg[:ogRest.LOG_LENGTH])
self.msg += '\r\n'
@@ -312,8 +312,7 @@ class ogRest():
not "poweroff" in URI and
not "probe" in URI):
if self.state == ThreadState.BUSY:
- logging.warn('Request has been received '
- 'while ogClient is busy')
+ logging.error('Request has been received while ogClient is busy')
response = restResponse(ogResponses.SERVICE_UNAVAILABLE, seq=client.seq)
client.send(response.get())
return
@@ -330,8 +329,7 @@ class ogRest():
elif "refresh" in URI:
self.process_refresh(client)
else:
- logging.warn('Unsupported request: %s',
- {URI[:ogRest.LOG_LENGTH]})
+ logging.error('Unsupported request: %s', {URI[:ogRest.LOG_LENGTH]})
response = restResponse(ogResponses.BAD_REQUEST, seq=client.seq)
client.send(response.get())
self.state = ThreadState.IDLE
@@ -359,8 +357,7 @@ class ogRest():
elif ("cache/fetch" in URI):
self.process_cache_fetch(client, request)
else:
- logging.warn('Unsupported request: %s',
- URI[:ogRest.LOG_LENGTH])
+ logging.error('Unsupported request: %s', URI[:ogRest.LOG_LENGTH])
response = restResponse(ogResponses.BAD_REQUEST, seq=client.seq)
client.send(response.get())
self.state = ThreadState.IDLE