From 7daa385d5e37bdd77c33ae373d4034dfcc5ce33e Mon Sep 17 00:00:00 2001 From: alexandredevely <12896316+alexandredevely@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:58:25 +0200 Subject: [PATCH] fix cupsd socket --- oc/od/orchestrator.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/oc/od/orchestrator.py b/oc/od/orchestrator.py index 6a0b8c7..c443cd7 100755 --- a/oc/od/orchestrator.py +++ b/oc/od/orchestrator.py @@ -3986,10 +3986,10 @@ def isinstance( app ): def get_DISPLAY( self, desktop_ip_addr:str='' ): raise NotImplementedError('get_DISPLAY') - def get_PULSE_SERVER( self, desktop_ip_addr:str='' ): + def get_PULSE_SERVER( self, desktop_ip_addr:str=None ): raise NotImplementedError('get_PULSE_SERVER') - def get_CUPS_SERVER( self, desktop_ip_addr:str='' ): + def get_CUPS_SERVER( self, desktop_ip_addr:str=None ): raise NotImplementedError('get_CUPS_SERVER') def get_env_for_appinstance(self, myDesktop, app, authinfo, userinfo={}, userargs=None, **kwargs ): @@ -4002,7 +4002,7 @@ def get_env_for_appinstance(self, myDesktop, app, authinfo, userinfo={}, userarg # make sure env DISPLAY, PULSE_SERVER,CUPS_SERVER exist # read the desktop (oc.user) ip address desktop_ip_addr = myDesktop.get_default_ipaddr('eth0') - + self.logger.debug( f"desktop_ip_addr={desktop_ip_addr}" ) # clone env env = oc.od.settings.desktop['environmentlocal'].copy() # update env with desktop_ip_addr if need @@ -4121,14 +4121,14 @@ def isinstance( ephemeralcontainer ): isinstance( ephemeralcontainer, V1ContainerStatus ) return bReturn - def get_DISPLAY( self, desktop_ip_addr:str='' ): + def get_DISPLAY( self, desktop_ip_addr:str=None ): return ':0.0' def get_PULSE_SERVER( self, desktop_ip_addr:str='' ): return 'unix:/tmp/.pulse.sock' - def get_CUPS_SERVER( self, desktop_ip_addr:str='' ): - return 'unix:/tmp/.cups.sock' + def get_CUPS_SERVER( self, desktop_ip_addr:str ): + return desktop_ip_addr + ':' + str(DEFAULT_CUPS_TCP_PORT) def envContainerApp(self, authinfo:AuthInfo, userinfo:AuthUser, pod_name:str, containerid:str )->dict: """get_env @@ -4585,7 +4585,7 @@ def findRunningAppInstanceforUserandImage( self, authinfo:AuthInfo, userinfo:Aut @oc.logging.with_logger() class ODAppInstanceKubernetesPod(ODAppInstanceBase): def __init__(self, orchestrator): - super().__init__( orchestrator) + super().__init__(orchestrator) self.type = self.orchestrator.pod_application @staticmethod @@ -4593,13 +4593,13 @@ def isinstance( pod:V1Pod ): bReturn = isinstance( pod, V1Pod ) return bReturn - def get_DISPLAY( self, desktop_ip_addr:str=None ): + def get_DISPLAY( self, desktop_ip_addr:str ): return desktop_ip_addr + ':0' + + def get_PULSE_SERVER( self, desktop_ip_addr:str ): + return desktop_ip_addr + ':' + str(DEFAULT_PULSE_TCP_PORT) - def get_PULSE_SERVER( self, desktop_ip_addr:str=None ): - return desktop_ip_addr + ':' + str(DEFAULT_PULSE_TCP_PORT) - - def get_CUPS_SERVER( self, desktop_ip_addr=None ): + def get_CUPS_SERVER( self, desktop_ip_addr:str ): return desktop_ip_addr + ':' + str(DEFAULT_CUPS_TCP_PORT) def get_nodeSelector( self ):