Merge lp:~danilo/linaro-license-protection/fix-deployment-script into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Данило Шеган
Status: Merged
Merged at revision: 100
Proposed branch: lp:~danilo/linaro-license-protection/fix-deployment-script
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 58 lines (+9/-9)
1 file modified
scripts/update-deployment.py (+9/-9)
To merge this branch: bzr merge lp:~danilo/linaro-license-protection/fix-deployment-script
Reviewer Review Type Date Requested Status
Stevan Radaković code Approve
Review via email: mp+119885@code.launchpad.net

Description of the change

Now that we have cronjob running the update-deployment script every half
an hour, it was easy to see that the working tree checkouts were not
being updated because they are not branches themselves (i.e. their branch
is up to date, but checkouts are working trees).

We were also always defaulting to a DEBUG error level which meant that
the script was never quiet (even without the -v options).

To post a comment you must log in.
Revision history for this message
Stevan Radaković (stevanr) wrote :

Looks good.
Approve +1.

review: Approve (code)

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-13 11:43:07 +0000
3+++ scripts/update-deployment.py 2012-08-16 10:25:42 +0000
4@@ -36,6 +36,7 @@
5
6 import argparse
7 import bzrlib.branch
8+import bzrlib.workingtree
9 import logging
10 import os
11 import subprocess
12@@ -55,8 +56,6 @@
13 "settings_staging_snapshots": staging_snapshots_root,
14 }
15
16-logging_level = logging.DEBUG
17-
18 code_root = os.path.join(code_base, branch_name)
19 configs_root = os.path.join(code_base, configs_branch_name)
20
21@@ -76,22 +75,22 @@
22 return code_branch
23
24
25-def update_branch(branch_dir):
26+def update_tree(working_tree_dir):
27 """Does a checkout update."""
28- code_branch = bzrlib.branch.Branch.open(branch_dir)
29- code_branch.update()
30+ code_tree = bzrlib.workingtree.WorkingTree.open(working_tree_dir)
31+ code_tree.update()
32
33
34 def update_installation(config, installation_root):
35 """Updates a single installation code and databases.
36
37- It expects code and config branches to be simple checkouts so it only
38- does an "update" on them.
39+ It expects code and config branches to be simple checkouts (working trees)
40+ so it only does an "update" on them.
41
42 Afterwards, it runs "syncdb" and "collectstatic" steps.
43 """
44- update_branch(os.path.join(installation_root, branch_name))
45- update_branch(os.path.join(installation_root, "configs"))
46+ update_tree(os.path.join(installation_root, branch_name))
47+ update_tree(os.path.join(installation_root, "configs"))
48 os.environ["PYTHONPATH"] = (
49 ":".join(
50 [installation_root,
51@@ -128,6 +127,7 @@
52 "Can be used multiple times"))
53 args = parser.parse_args()
54
55+ logging_level = logging.ERROR
56 if args.verbose == 0:
57 logging_level = logging.ERROR
58 elif args.verbose == 1:

Subscribers

People subscribed via source and target branches