Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredevely committed Aug 10, 2023
1 parent 726f9ec commit ac1b54f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions oc/od/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2838,8 +2838,9 @@ def createdesktop(self, authinfo:AuthInfo, userinfo:AuthUser, **kwargs)->ODDeskt
env[ 'PULSEAUDIO_COOKIE' ] = self.generate_pulseaudiocookie() # generate PULSEAUDIO cookie
env[ 'BROADCAST_COOKIE' ] = self.generate_broadcastcookie() # generate BROADCAST cookie
env[ 'HOME'] = self.get_user_homedirectory(authinfo, userinfo) # read HOME DIR
env[ 'USER' ] = userinfo.userid # add USER
env[ 'USER' ] = userinfo.userid # add USER
env[ 'LOGNAME' ] = userinfo.userid # add LOGNAME
env[ 'USERNAME' ] = userinfo.userid # add USERNAME
self.logger.debug( f"HOME={env[ 'HOME']}")
self.logger.debug('env created')

Expand Down Expand Up @@ -3742,17 +3743,19 @@ def get_CUPS_SERVER( self, desktop_ip_addr:str='' ):
raise NotImplementedError('get_CUPS_SERVER')

def get_env_for_appinstance(self, myDesktop, app, authinfo, userinfo={}, userargs=None, **kwargs ):
assert isinstance(myDesktop, ODDesktop), f"desktop has invalid type {type(myDesktop)}"
assert isinstance(myDesktop, ODDesktop), f"desktop has invalid type {type(myDesktop)}"
assert isinstance(authinfo, AuthInfo), f"authinfo has invalid type {type(authinfo)}"
assert isinstance(userinfo, AuthUser), f"userinfo has invalid type {type(userinfo)}"

posixuser = self.orchestrator.alwaysgetPosixAccountUser( authinfo, userinfo )

# make sure env DISPLAY, PULSE_SERVER,CUPS_SERVER exist
# read the desktop (oc.user) ip address
desktop_ip_addr = myDesktop.get_default_ipaddr('eth0')

# clone env
env = oc.od.settings.desktop['environmentlocal'].copy()

# update env with desktop_ip_addr if need
env['DISPLAY'] = self.get_DISPLAY(desktop_ip_addr)
env['CONTAINER_IP_ADDR'] = desktop_ip_addr # CONTAINER_IP_ADDR is used by ocrun node js command
env['XAUTH_KEY'] = myDesktop.xauthkey
Expand Down

0 comments on commit ac1b54f

Please sign in to comment.