Merge lp:~rconradharris/glance/lp711385 into lp:~glance-coresec/glance/cactus-trunk

Proposed by Rick Harris
Status: Merged
Approved by: Rick Harris
Approved revision: 61
Merged at revision: 60
Proposed branch: lp:~rconradharris/glance/lp711385
Merge into: lp:~glance-coresec/glance/cactus-trunk
Diff against target: 82 lines (+26/-5)
4 files modified
bin/glance-combined (+2/-0)
bin/glance-registry (+2/-4)
glance/registry/db/__init__.py (+13/-0)
run_tests.sh (+9/-1)
To merge this branch: bzr merge lp:~rconradharris/glance/lp711385
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Devin Carlen (community) Approve
Review via email: mp+48230@code.launchpad.net

Description of the change

Adds back --sql-connection option

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi!

Looks good, but found a small typo:

40 + glance.registry.db.add_option(parser)

Should be add_options(), not add_option(). :)

-jay

review: Needs Fixing
lp:~rconradharris/glance/lp711385 updated
61. By Rick Harris

Typo add_option -> add_options

Revision history for this message
Rick Harris (rconradharris) wrote :

Doh, good catch. Pushed fix.

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

coolio.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/glance-combined'
2--- bin/glance-combined 2011-01-31 18:46:04 +0000
3+++ bin/glance-combined 2011-02-01 19:55:53 +0000
4@@ -35,6 +35,7 @@
5 from glance import version
6 from glance.common import config
7 from glance.common import server
8+import glance.registry.db
9 import glance.store
10
11
12@@ -98,6 +99,7 @@
13 "virtual machine images to. Choices: ('%s') "
14 "Default: %%default" % "','".join(DEFAULT_STORE_CHOICES))
15 glance.store.add_options(parser)
16+ glance.registry.db.add_options(parser)
17
18
19 def main(_args):
20
21=== modified file 'bin/glance-registry'
22--- bin/glance-registry 2011-01-31 18:21:30 +0000
23+++ bin/glance-registry 2011-02-01 19:55:53 +0000
24@@ -30,6 +30,7 @@
25
26 sys.path.append(ROOT_DIR)
27
28+import glance.registry.db
29 from glance import version
30 from glance.common import config
31 from glance.common import server
32@@ -75,10 +76,7 @@
33 help="uid under which to run. Default: %default")
34 parser.add_option("--gid", type=int, default=os.getgid(),
35 help="gid under which to run. Default: %default")
36- parser.add_option('--sql-connection', metavar="CONNECTION",
37- default='sqlite:///glance.sqlite',
38- help="A valid SQLAlchemy connection string for the "
39- "registry database. Default: %default")
40+ glance.registry.db.add_options(parser)
41
42
43 def main(_args):
44
45=== modified file 'glance/registry/db/__init__.py'
46--- glance/registry/db/__init__.py 2011-01-31 19:39:39 +0000
47+++ glance/registry/db/__init__.py 2011-02-01 19:55:53 +0000
48@@ -16,3 +16,16 @@
49 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
50 # License for the specific language governing permissions and limitations
51 # under the License.
52+
53+
54+def add_options(parser):
55+ """
56+ Adds any configuration options that the db layer might have.
57+
58+ :param parser: An optparse.OptionParser object
59+ :retval None
60+ """
61+ parser.add_option('--sql-connection', metavar="CONNECTION",
62+ default='sqlite:///glance.sqlite',
63+ help="A valid SQLAlchemy connection string for the "
64+ "registry database. Default: %default")
65
66=== modified file 'run_tests.sh'
67--- run_tests.sh 2011-01-27 04:19:13 +0000
68+++ run_tests.sh 2011-02-01 19:55:53 +0000
69@@ -71,4 +71,12 @@
70 fi
71 fi
72
73-run_tests && pep8 --repeat --show-pep8 --show-source bin/* glance setup.py run_tests.py || exit 1
74+# FIXME(sirp): bzr version-info is not currently pep-8. This was fixed with
75+# lp701898 [1], however, until that version of bzr becomes standard, I'm just
76+# excluding the vcsversion.py file
77+#
78+# [1] https://bugs.launchpad.net/bzr/+bug/701898
79+#
80+PEP8_EXCLUDE=vcsversion.py
81+PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat --show-pep8 --show-source"
82+run_tests && pep8 $PEP8_OPTIONS bin/* glance setup.py run_tests.py || exit 1

Subscribers

People subscribed via source and target branches