aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDanilo Segan <danilo@canonical.com>2012-08-30 13:01:28 +0200
committerDanilo Segan <danilo@canonical.com>2012-08-30 13:01:28 +0200
commite7b4addfea5eae4f2e488c8a5c011a3fe734a5b6 (patch)
tree4af3d17555d69c41e8a2efd9e22ef707e94fee71 /scripts
parent0d020158e2dbf40e2793980515f2476345387c0d (diff)
Add apache bouncing to the update-deployment script.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-deployment.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/update-deployment.py b/scripts/update-deployment.py
index 30ebbe0..0c1959b 100755
--- a/scripts/update-deployment.py
+++ b/scripts/update-deployment.py
@@ -66,6 +66,7 @@ class UpdateDeploymentScript(LinaroScript):
self.run_subcommand(["bzr", "up"], branch_dir)
def run_subcommand(self, arguments, cwd=None):
+ self.logger.debug("In %s, running: %s\n", cwd, str(arguments))
process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process_out, process_err = process.communicate()
@@ -114,6 +115,9 @@ class UpdateDeploymentScript(LinaroScript):
def setup_parser(self):
super(UpdateDeploymentScript, self).setup_parser()
self.argument_parser.add_argument(
+ '--bounce-apache', action='store_true', default=False,
+ help="Whether to make Apache reload the configuration.")
+ self.argument_parser.add_argument(
'configs', metavar='CONFIG', nargs='+',
choices=configs_to_use.keys(),
help=("Django configuration module to use. One of " +
@@ -128,6 +132,10 @@ class UpdateDeploymentScript(LinaroScript):
for config in self.arguments.configs:
self.update_installation(config, configs_to_use[config])
+ # Finally, bounce apache.
+ if self.arguments.bounce_apache:
+ self.run_subcommand(["sudo", "/etc/init.d/apache2", "reload"])
+
if __name__ == '__main__':
script = UpdateDeploymentScript(