Opened on 03/31/2016 at 03:53:31 PM

Closed on 03/31/2016 at 05:22:38 PM

#3881 closed defect (fixed)

Provide sitescripts.ini even if no settings are required

Reported by: matze Assignee: matze
Priority: P2 Milestone:
Module: Infrastructure Keywords:
Cc: kvas Blocked By:
Blocking: #2248 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29339227

Description

From: Cron Daemon <root@web-subscribe-abp-org-1>
Date: Thu, Mar 31, 2016 at 5:15 PM
Subject: Cron <www@web-subscribe-abp-org-1> python -m sitescripts.docs.bin.generate_docs
To: root@web-subscribe-abp-org-1

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/sitescripts/sitescripts/docs/bin/generate_docs.py", line 84, in <module>
    config = get_config()
  File "/opt/sitescripts/sitescripts/utils.py", line 41, in wrapped
    self.lastResult[args, key] = func(*args, **kwargs)
  File "/opt/sitescripts/sitescripts/utils.py", line 80, in get_config
    raise Exception('No config file found. Please put sitescripts.ini into your home directory or /etc')
Exception: No config file found. Please put sitescripts.ini into your home directory or /etc

Puppet class sitescripts does not create the /etc/sitescripts.ini file if no explicit settings/snippets are set up. Although this could be valid behavior in general, but in order to avoid the above issue we obviously need to ensure the file's presence even in those cases.

Attachments (0)

Change History (5)

comment:1 Changed on 03/31/2016 at 04:16:31 PM by matze

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 03/31/2016 at 04:20:56 PM by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/infrastructure/rev/5a9f7f912f4c

comment:3 Changed on 03/31/2016 at 04:47:16 PM by matze

While the 1st patch-set ensures sitescripts.ini being present, we still need a follow-up:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/sitescripts/sitescripts/docs/bin/generate_docs.py", line 85, in <module>
    projects = read_projects(config)
  File "/opt/sitescripts/sitescripts/docs/bin/generate_docs.py", line 26, in read_projects
    for key, value in config.items("docs"):
  File "/usr/lib/python2.7/ConfigParser.py", line 642, in items
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'docs'

In #3637 resource Cron['generate_docs'] was introduced, depending on sitescripts configuration section [docs] which, so far, is not always included. This leads to the above error on static web::server nodes.

Last edited on 03/31/2016 at 04:47:51 PM by matze

comment:4 Changed on 03/31/2016 at 04:48:51 PM by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/infrastructure/rev/ac60baf3165d

comment:5 Changed on 03/31/2016 at 05:22:38 PM by matze

  • Blocking 2248 added
  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from matze.
 
Note: See TracTickets for help on using tickets.