Merge lp:~danilo/linaro-license-protection/bounce-apache into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Данило Шеган
Status: Merged
Approved by: Georgy Redkozubov
Approved revision: 126
Merged at revision: 126
Proposed branch: lp:~danilo/linaro-license-protection/bounce-apache
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 32 lines (+8/-0)
1 file modified
scripts/update-deployment.py (+8/-0)
To merge this branch: bzr merge lp:~danilo/linaro-license-protection/bounce-apache
Reviewer Review Type Date Requested Status
Georgy Redkozubov Approve
Review via email: mp+122033@code.launchpad.net

Description of the change

Use the command as allowed in https://rt.linaro.org/Ticket/Display.html?id=584
to bounce Apache to allow staging deployments to be fully automatic.

We'll have to modify the cronjob to include --bounce-apache command line option as well.

To post a comment you must log in.
Revision history for this message
Georgy Redkozubov (gesha) wrote :

Looks good. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/update-deployment.py'
2--- scripts/update-deployment.py 2012-08-23 18:43:44 +0000
3+++ scripts/update-deployment.py 2012-08-30 11:04:20 +0000
4@@ -66,6 +66,7 @@
5 self.run_subcommand(["bzr", "up"], branch_dir)
6
7 def run_subcommand(self, arguments, cwd=None):
8+ self.logger.debug("In %s, running: %s\n", cwd, str(arguments))
9 process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,
10 stderr=subprocess.PIPE)
11 process_out, process_err = process.communicate()
12@@ -114,6 +115,9 @@
13 def setup_parser(self):
14 super(UpdateDeploymentScript, self).setup_parser()
15 self.argument_parser.add_argument(
16+ '--bounce-apache', action='store_true', default=False,
17+ help="Whether to make Apache reload the configuration.")
18+ self.argument_parser.add_argument(
19 'configs', metavar='CONFIG', nargs='+',
20 choices=configs_to_use.keys(),
21 help=("Django configuration module to use. One of " +
22@@ -128,6 +132,10 @@
23 for config in self.arguments.configs:
24 self.update_installation(config, configs_to_use[config])
25
26+ # Finally, bounce apache.
27+ if self.arguments.bounce_apache:
28+ self.run_subcommand(["sudo", "/etc/init.d/apache2", "reload"])
29+
30
31 if __name__ == '__main__':
32 script = UpdateDeploymentScript(

Subscribers

People subscribed via source and target branches