Merge lp:~danilo/linaro-license-protection/python26-compat into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Данило Шеган
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 118
Merged at revision: 116
Proposed branch: lp:~danilo/linaro-license-protection/python26-compat
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 64 lines (+22/-6)
2 files modified
scripts/linaroscript.py (+3/-1)
scripts/update-deployment.py (+19/-5)
To merge this branch: bzr merge lp:~danilo/linaro-license-protection/python26-compat
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+121061@code.launchpad.net

Description of the change

python2.6 compat for lucid.

subprocess module has no call_output() and a few other small tidbits.

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

What, no tests for the deploy script changes?

:p

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

Shush. :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/linaroscript.py'
--- scripts/linaroscript.py 2012-08-22 22:27:28 +0000
+++ scripts/linaroscript.py 2012-08-23 17:19:22 +0000
@@ -55,8 +55,10 @@
55 if verbosity == 0:55 if verbosity == 0:
56 logging_level = logging.ERROR56 logging_level = logging.ERROR
57 elif verbosity == 1:57 elif verbosity == 1:
58 logging_level = logging.WARNING
59 elif verbosity == 2:
58 logging_level = logging.INFO60 logging_level = logging.INFO
59 elif verbosity >= 2:61 elif verbosity >= 3:
60 logging_level = logging.DEBUG62 logging_level = logging.DEBUG
61 else:63 else:
62 logging_level = logging.ERROR64 logging_level = logging.ERROR
6365
=== modified file 'scripts/update-deployment.py'
--- scripts/update-deployment.py 2012-08-22 22:27:28 +0000
+++ scripts/update-deployment.py 2012-08-23 17:19:22 +0000
@@ -1,4 +1,4 @@
1#!/usr/bin/env python2.71#!/usr/bin/env python
22
3"""Update a deployment of lp:linaro-license-protection.3"""Update a deployment of lp:linaro-license-protection.
44
@@ -84,6 +84,20 @@
84 code_tree = bzrlib.workingtree.WorkingTree.open(working_tree_dir)84 code_tree = bzrlib.workingtree.WorkingTree.open(working_tree_dir)
85 code_tree.update()85 code_tree.update()
8686
87 def run_subcommand(self, arguments, cwd=None):
88 process = subprocess.Popen(arguments, cwd=cwd, stdout=subprocess.PIPE,
89 stderr=subprocess.PIPE)
90 process_out, process_err = process.communicate()
91 if process_out is not None:
92 self.logger.debug(
93 "stdout:\n" + "\n\t".join(process_out.splitlines()))
94 if process_err is not None:
95 self.logger.debug(
96 "stderr:\n" + "\n\t".join(process_err.splitlines()))
97 if process.returncode != 0:
98 self.logger.error(
99 "FAILED %d", process.returncode)
100
87 def update_installation(self, config, installation_root):101 def update_installation(self, config, installation_root):
88 """Updates a single installation code and databases.102 """Updates a single installation code and databases.
89103
@@ -108,13 +122,13 @@
108 os.environ.get("DJANGO_SETTINGS_MODULE"))122 os.environ.get("DJANGO_SETTINGS_MODULE"))
109123
110 self.logger.debug("Doing 'syncdb'...")124 self.logger.debug("Doing 'syncdb'...")
111 self.logger.debug(subprocess.check_output(125 self.run_subcommand(
112 ["django-admin", "syncdb", "--noinput"], cwd=code_root))126 ["django-admin", "syncdb", "--noinput"], cwd=code_root)
113127
114 self.logger.debug("Doing 'collectstatic'...")128 self.logger.debug("Doing 'collectstatic'...")
115 self.logger.debug(subprocess.check_output(129 self.run_subcommand(
116 ["django-admin", "collectstatic", "--noinput"],130 ["django-admin", "collectstatic", "--noinput"],
117 cwd=code_root))131 cwd=code_root)
118132
119 def setup_parser(self):133 def setup_parser(self):
120 super(UpdateDeploymentScript, self).setup_parser()134 super(UpdateDeploymentScript, self).setup_parser()

Subscribers

People subscribed via source and target branches