Skip to content

Commit 416b284

Browse files
committed
Better error message running with -c and pywin32 is not importable.
Atempting to do this. It should work on windows, but I can't test.
1 parent 17e567e commit 416b284

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ v2.7.2 or later are required to run newer releases of Roundup. From v2.0
1212
onwards Python 3.4 and later are also supported.
1313

1414

15+
2019-xx-xx 2.0.0...
16+
17+
Features:
18+
19+
Fixed:
20+
21+
- issue2550996 - Give better error message when running with -c
22+
(install as windows service) and pywin32 is not importable. Could use
23+
better testing on a windows box. (John Rouillard)
24+
1525
2019-10-23 2.0.0 alpha 0
1626

1727
Features:

roundup/scripts/roundup_server.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,7 @@ def run(port=undefined, success_message=None):
951951
'''
952952
config = ServerConfig()
953953
# additional options
954-
short_options = "hvS"
955-
if RoundupService:
956-
short_options += 'c'
954+
short_options = "hvSc"
957955
try:
958956
(optlist, args) = config.getopt(sys.argv[1:],
959957
short_options, ("help", "version", "save-config",))
@@ -963,6 +961,17 @@ def run(port=undefined, success_message=None):
963961

964962
# if running in windows service mode, don't do any other stuff
965963
if ("-c", "") in optlist:
964+
global RoundupService
965+
if not RoundupService:
966+
RoundupService = True # make sure usage displays -c help text
967+
error_m = """
968+
ERROR: -c is not available because roundup couldn't import
969+
win32serviceutil from pywin32. See Installation docs
970+
for pywin32 details.
971+
"""
972+
usage(error_m)
973+
return
974+
966975
# acquire command line options recognized by service
967976
short_options = "cC:"
968977
long_options = ["config"]

0 commit comments

Comments
 (0)