Merge lp:~frankban/lpsetup/create-scripts into lp:lpsetup
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2012-04-11 |
| Approved revision: | 19 |
| Merged at revision: | 12 |
| Proposed branch: | lp:~frankban/lpsetup/create-scripts |
| Merge into: | lp:lpsetup |
| Diff against target: |
558 lines (+393/-4) 8 files modified
lpsetup/settings.py (+7/-0) lpsetup/subcommands/lxcinstall.py (+49/-0) lpsetup/templates/lp-setup-lxc-build (+48/-0) lpsetup/templates/lp-setup-lxc-cleanup (+33/-0) lpsetup/templates/lp-setup-lxc-test (+20/-0) lpsetup/tests/test_handlers.py (+2/-1) lpsetup/tests/test_utils.py (+107/-0) lpsetup/utils.py (+127/-3) |
| To merge this branch: | bzr merge lp:~frankban/lpsetup/create-scripts |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Graham Binns (community) | code | 2012-04-11 | Approve on 2012-04-11 |
|
Review via email:
|
|||
Description of the Change
== Changes ==
lpsetup is now capable to generate the scripts used by buildbot in parallel tests. A new step `create_scripts` is now part of the lxc-install sub command.
Since the script generation is probably only needed by buildbot, this step is only activated if --create-scripts argument is passed to lxc-install.
The script templates are present in the `templates` directory of the lpsetup package: theese templates are used to actually render the scripts (usually saving them in /usr/local/bin).
The Scrubber class is now separated from the cleanup script, and the tests Brad wrote are integrated in lpsetup, with some fixes:
- Scrubber now takes the lxc name to dynamically generate the directory patterns used to clean up the file system.
- I've found that, having containers running in my machine, Scrubber tests failed because I need to be root to run lxc-info. Vice versa, running the tests as root, they passed but my containers were killed. To work around this, I've added an optional argument `ignored_
- PEP8 compliant naming for the Scrubber methods.
Updated the (naive) method used to retrieve the user home directory in a test.
== Tests ==
$ bin/test
Running zope.testrunner
Set up zope.testrunner
Ran 46 tests with 0 failures and 0 errors in 0.469 seconds.
Tearing down left over layers:
Tear down zope.testrunner
| Brad Crittenden (bac) wrote : | # |
| Francesco Banconi (frankban) wrote : | # |
Thanks for your comment Brad, but now I'm confused: of course lpsetup is a launchpad related project, but it's not lp itself, it's a separate branch/project, so I thought consistency with the launchpad code style was not a problem. Indeed right now lpsetup uses PEP-8 naming convention everywhere in the code.
However, there is a high possibility that I was wrong at the time (in my interpretation of what is "launchpad related") and there is no problem in replacing method names if we decide so.
| Graham Binns (gmb) wrote : | # |
Context for latecomers: After conversation with Gary, it's been decided to leave the PEP8 naming in place, since it's common throughout lpsetup.

Hi Francesco,
This isn't a full review as Graham is doing it. I would like to comment on your decision to use PEP-8 naming for methods.
For Launchpad-related projects such as this one I think we should continue to follow the Launchpad style guide: https:/ /dev.launchpad. net/PythonStyle Guide
Launchpad has agreed to use camelCase for method names as an exception to the PEP-8 guide.
I'd like for us to either continue following the LP style guide or agree not to.