Skip to content

Commit

Permalink
fixing position of function
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMatter committed Feb 18, 2024
1 parent 8f98e22 commit fda9dae
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
import platform
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
# Set up logging
Expand Down Expand Up @@ -221,15 +233,3 @@ async def 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}'

0 comments on commit fda9dae

Please sign in to comment.