Skip to content

Commit a74879c

Browse files
committed
Fail loudly and immediately if we can't gen docs
If htmlgen fails, the whole process fails immediately and you get a non zero RC. Previously it would just move on to the rendering step, which makes it harder to notice build errors. You now get: ...rds ...redshift ...route53 ...s3 ...s3api Traceback (most recent call last): File "aws-cli/doc/source/htmlgen", line 108, in <module> do_provider(driver) File "aws-cli/doc/source/htmlgen", line 66, in do_provider do_service(driver, REF_PATH, service_name, service_command) File "aws-cli/doc/source/htmlgen", line 48, in do_service help_command(None, None) File "aws-cli/awscli/help.py", line 232, in __call__ bcdoc.docevents.generate_events(self.session, self) File "bcdoc/docevents.py", line 50, in generate_events help_command.name, help_command=help_command) File "bcdoc/docevents.py", line 36, in fire_event session.emit(event, **kwargs) File "botocore/botocore/session.py", line 551, in emit return self._events.emit(event_name, **kwargs) File "botocore/botocore/hooks.py", line 158, in emit response = handler(**kwargs) File "aws-cli/awscli/clidocs.py", line 243, in doc_description doc.include_doc_string(service.documentation) AttributeError: 'Service' object has no attribute 'documentation' Failed to generate documetation! make: *** [html] Error 2 $ echo $? 2
1 parent f999b7f commit a74879c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

doc/source/bootstrapdocs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import json
22
import os
33
import subprocess
4+
import sys
45

56
RST_GENERATION_SCRIPT = 'htmlgen'
67
script_path = os.path.join(os.path.dirname(__file__),
78
RST_GENERATION_SCRIPT)
89
os.environ['PATH'] += ':.'
9-
#status = os.spawnlpe(os.P_WAIT, script_path, os.environ)
10-
subprocess.call("python "+script_path, shell=True, env=os.environ)
10+
rc = subprocess.call("python "+ script_path, shell=True, env=os.environ)
11+
if rc != 0:
12+
sys.stderr.write("Failed to generate documetation!\n")
13+
sys.exit(2)

0 commit comments

Comments
 (0)