fixing position of function

This commit is contained in:
Benjamin Harder
2024-02-18 23:17:01 +01:00
parent 8f98e22a40
commit fda9daeb4d

24
main.py
View File

@@ -12,6 +12,18 @@ import requests
import platform import platform
from packaging import version from packaging import version
import docker
def get_image_tag():
# Retrieves the github version tag of the docker image
client = docker.from_env()
try:
container_info = client.containers.get('decluttarr')
image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided')
return image_tag
except docker.errors.NotFound:
return 'Container not found'
except Exception as e:
return f'Error retrieving image tag: {e}'
########### Enabling Logging ########### Enabling Logging
# Set up logging # Set up logging
@@ -221,15 +233,3 @@ if __name__ == '__main__':
asyncio.run(main()) asyncio.run(main())
import docker
def get_image_tag():
client = docker.from_env()
try:
container_info = client.containers.get('decluttarr')
image_tag = container_info.labels.get('decluttarr.version', 'No image tag provided')
return image_tag
except docker.errors.NotFound:
return 'Container not found'
except Exception as e:
return f'Error retrieving image tag: {e}'