Skip to content

Commit

Permalink
change img_path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Nov 26, 2024
1 parent 08045ee commit 8ac49ab
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions oc/od/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def __init__(self, mongodburl=None ):
self.private_attr_list = [ 'acl', 'rules', 'securityContext' ]
self.thead_event = None

# img path
self.img_path = '/img/app/'

# mongo db defines
self.databasename = 'applications'
self.index_name = 'id' # id is the name of the image repoTags[0]
Expand Down Expand Up @@ -110,21 +113,19 @@ def list_app_images( self ):


def makeicon_url(self, filename ):
self.img_path = '/img/app/'
icon_url = oc.od.settings.default_host_url + self.img_path + filename
return icon_url


def makeicon_file(self, filename, b64data):
bReturn = False
self.img_path = '/img/app/'

if filename is None or b64data is None:
return bReturn

# normalise trust no one
# hard code image path
currentPath = os.getcwd() # '/var/pyos' or os.getcwd()
filepath = os.path.normpath( currentPath + self.img_path + filename )
img_directory = os.getcwd() + self.img_path # /var/pyos/img/app
filepath = os.path.join( img_directory, filename )
filepath = os.path.normpath( filepath )
try:
f = None
strdecode = base64.b64decode(b64data)
Expand Down

0 comments on commit 8ac49ab

Please sign in to comment.