summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-04 22:46:56 +0000
committerGerrit Code Review <review@openstack.org>2018-09-04 22:46:56 +0000
commit6106a9051f393b6140fb60e452cf384cb96616fa (patch)
tree660adeeffece8faad84a8ea64a2e3ee69f524f7d
parenta5136b73add0b8b287859bd192135d78f5dd56a5 (diff)
parent6b9fa90602d41cd51265e402c2009d1a03fe730d (diff)
Merge "Improve warning details"0.2.4
-rw-r--r--zuul_sphinx/zuul.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/zuul_sphinx/zuul.py b/zuul_sphinx/zuul.py
index 631afc9..114f0d3 100644
--- a/zuul_sphinx/zuul.py
+++ b/zuul_sphinx/zuul.py
@@ -491,15 +491,17 @@ class ZuulAutoJobsDirective(ZuulDirective):
491 has_content = False 491 has_content = False
492 492
493 def run(self): 493 def run(self):
494 lines = [] 494 env = self.state.document.settings.env
495 names = set() 495 names = set()
496 for job in self.zuul_layout.jobs: 496 for job in self.zuul_layout.jobs:
497 name = job['name'] 497 name = job['name']
498 if name in names: 498 if name in names:
499 continue 499 continue
500 lines.extend(self.generate_zuul_job_content(name)) 500 lines = self.generate_zuul_job_content(name)
501 location = 'Job "%s" included in %s' % \
502 (name, env.doc2path(env.docname))
503 self.state_machine.insert_input(lines, location)
501 names.add(name) 504 names.add(name)
502 self.state_machine.insert_input(lines, self.zuul_layout_path)
503 return [] 505 return []
504 506
505class ZuulAutoProjectTemplateDirective(ZuulDirective): 507class ZuulAutoProjectTemplateDirective(ZuulDirective):
@@ -514,15 +516,17 @@ class ZuulAutoProjectTemplatesDirective(ZuulDirective):
514 has_content = False 516 has_content = False
515 517
516 def run(self): 518 def run(self):
517 lines = [] 519 env = self.state.document.settings.env
518 names = set() 520 names = set()
519 for template in self.zuul_layout.project_templates: 521 for template in self.zuul_layout.project_templates:
520 name = template.name 522 name = template.name
521 if name in names: 523 if name in names:
522 continue 524 continue
523 lines.extend(self.generate_zuul_project_template_content(name)) 525 lines = self.generate_zuul_project_template_content(name)
526 location = 'Template "%s" included in %s' % \
527 (name, env.doc2path(env.docname))
528 self.state_machine.insert_input(lines, location)
524 names.add(name) 529 names.add(name)
525 self.state_machine.insert_input(lines, self.zuul_layout_path)
526 return [] 530 return []
527 531
528 532