Skip to content

Commit

Permalink
#2407 fix ignored socket-dirs
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@23762 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 10, 2019
1 parent b7688eb commit e1148df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
18 changes: 6 additions & 12 deletions src/xpra/scripts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ def get_defaults():
OPEN_COMMAND, DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS,
DEFAULT_ENV, CAN_DAEMONIZE, SYSTEM_PROXY_SOCKET,
)
from xpra.platform.paths import get_download_dir, get_remote_run_xpra_scripts
from xpra.platform.paths import get_download_dir, get_remote_run_xpra_scripts, get_socket_dirs
try:
from xpra.platform.info import get_username
username = get_username()
Expand Down Expand Up @@ -1015,7 +1015,7 @@ def get_defaults():
"bandwidth-detection" : True,
"ssh-upgrade" : True,
"pulseaudio-configure-commands" : [" ".join(x) for x in DEFAULT_PULSEAUDIO_CONFIGURE_COMMANDS],
"socket-dirs" : [],
"socket-dirs" : get_socket_dirs(),
"remote-xpra" : get_remote_run_xpra_scripts(),
"encodings" : ["all"],
"proxy-video-encoders" : [],
Expand Down Expand Up @@ -1300,14 +1300,8 @@ def getlist(strarg, help_txt, all_list_name):
options.video_decoders = getlist(vdstr, "video decoders", "ALL_VIDEO_DECODER_OPTIONS")
options.proxy_video_encoders = getlist(pvestr, "proxy video encoders", "HARDWARE_ENCODER_OPTIONS")

def fixup_socketdirs(options, defaults):
if not options.socket_dirs:
from xpra.platform.paths import get_socket_dirs
if defaults:
options.socket_dirs = getattr(defaults, "socket_dirs", get_socket_dirs())
else:
options.socket_dirs = get_socket_dirs()
elif isinstance(options.socket_dirs, str):
def fixup_socketdirs(options):
if isinstance(options.socket_dirs, str):
options.socket_dirs = options.socket_dirs.split(os.path.pathsep)
else:
assert isinstance(options.socket_dirs, (list, tuple))
Expand Down Expand Up @@ -1424,13 +1418,13 @@ def abs_paths(options):
continue
setattr(options, f, os.path.abspath(v))

def fixup_options(options, defaults=None):
def fixup_options(options):
fixup_pings(options)
fixup_encodings(options)
fixup_compression(options)
fixup_packetencoding(options)
fixup_video_all_or_none(options)
fixup_socketdirs(options, defaults)
fixup_socketdirs(options)
fixup_clipboard(options)
fixup_keyboard(options)
abs_paths(options)
Expand Down
6 changes: 3 additions & 3 deletions src/xpra/scripts/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,8 @@ def ignore(defaults):
help="How often to synchronize the virtual framebuffer used for X11 seamless servers "
+"(0 to disable)."
+" Default: %s." % defaults.sync_xvfb)
group.add_option("--socket-dirs", action="append",
dest="socket_dirs", default=[],
group.add_option("--socket-dirs", action="store",
dest="socket_dirs", default=defaults.socket_dirs,
help="Directories to look for the socket files in."
+" Default: %s." % os.path.pathsep.join("'%s'" % x for x in defaults.socket_dirs))
default_socket_dir_str = defaults.socket_dir or "$XPRA_SOCKET_DIR or the first valid directory in socket-dirs"
Expand Down Expand Up @@ -1253,7 +1253,7 @@ def ignore(defaults):

#special case for things stored as lists, but command line option is a CSV string:
#and may have "none" or "all" special values
fixup_options(options, defaults)
fixup_options(options)

try:
options.dpi = int(options.dpi)
Expand Down
4 changes: 0 additions & 4 deletions src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,6 @@ def noerr(fn, *args):

#setup unix domain socket:
netlog = get_network_logger()
if not opts.socket_dir and not opts.socket_dirs:
#we always need at least one valid socket dir
from xpra.platform.paths import get_socket_dirs
opts.socket_dirs = get_socket_dirs()
local_sockets = setup_local_sockets(opts.bind,
opts.socket_dir, opts.socket_dirs,
display_name, clobber,
Expand Down

0 comments on commit e1148df

Please sign in to comment.