Merge lp:~widelands-dev/widelands-website/add_DISPLAY_hint into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 407
Proposed branch: lp:~widelands-dev/widelands-website/add_DISPLAY_hint
Merge into: lp:widelands-website
Diff against target: 33 lines (+4/-0)
1 file modified
wlhelp/management/commands/update_help.py (+4/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/add_DISPLAY_hint
Reviewer Review Type Date Requested Status
kaputtnik (community) Needs Resubmitting
GunChleoc Approve
Review via email: mp+296491@code.launchpad.net

Description of the change

If wl_map_object_info fails when running update_help on the website, the error message gives a hint how to possible fix this.

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM

review: Approve
408. By kaputtnik

exit the script on error

Revision history for this message
kaputtnik (franku) wrote :

Thanks for approving, but it needs a resubmit.

If wl_map_object_info doesn't work the script should stop also to progress and should exit with code 1.

Seems to be a never ending story :-)

review: Needs Resubmitting
Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes, good point!
Not tested but still LGTM.

409. By kaputtnik

the script should end on each failure

Revision history for this message
kaputtnik (franku) wrote :

Since automatic updates working now, i have removed the hint regarding display.

But added code to stop the script if one of the dependent sub processes fails.

Revision history for this message
kaputtnik (franku) :
review: Needs Resubmitting
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fine by me :)

Revision history for this message
kaputtnik (franku) wrote :

Merged and deployed.

Thanks to GunChleoc for this amazing work :-)

And sorry that i haven't named you in the previous merge.

Revision history for this message
GunChleoc (gunchleoc) wrote :

No problem - I'm not here for the LOOK AT ME! platinum star award :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wlhelp/management/commands/update_help.py'
2--- wlhelp/management/commands/update_help.py 2016-05-22 11:35:57 +0000
3+++ wlhelp/management/commands/update_help.py 2016-06-05 15:55:30 +0000
4@@ -18,6 +18,7 @@
5 from django.core.management.base import BaseCommand, CommandError
6
7 import os
8+import sys
9 from os import makedirs, path
10 import shutil
11 import re
12@@ -297,6 +298,7 @@
13 except:
14 print(
15 "Error: Unable to execute 'wl_map_object_info' for generating the JSON files.")
16+ sys.exit(1)
17
18 # Now we validate that they are indeed JSON files (syntax check only)
19 validator_script = os.path.normpath(
20@@ -304,12 +306,14 @@
21 if not os.path.isfile(validator_script):
22 print("Wrong path for 'utils/validate_json.py': " +
23 validator_script + ' does not exist!')
24+ sys.exit(1)
25 try:
26 subprocess.check_call(
27 [validator_script, json_directory])
28 is_json_valid = True
29 except:
30 print('Error: JSON files are not valid.')
31+ sys.exit(1)
32
33 os.chdir(current_dir)
34

Subscribers

People subscribed via source and target branches