Merge lp:~sandy-walsh/nova/xs_pause into lp:~tr3buchet/nova/xs_pause

Proposed by Sandy Walsh
Status: Merged
Merge reported by: Trey Morris
Merged at revision: not available
Proposed branch: lp:~sandy-walsh/nova/xs_pause
Merge into: lp:~tr3buchet/nova/xs_pause
Diff against target: 176 lines (+83/-7)
6 files modified
Authors (+2/-0)
nova/api/ec2/cloud.py (+0/-1)
nova/api/openstack/__init__.py (+8/-0)
nova/compute/api.py (+11/-6)
nova/tests/api/openstack/test_adminapi.py (+61/-0)
tools/pip-requires (+1/-0)
To merge this branch: bzr merge lp:~sandy-walsh/nova/xs_pause
Reviewer Review Type Date Requested Status
Trey Morris Approve
Review via email: mp+43223@code.launchpad.net

Description of the change

Trey ... this is merged with new trunk from this morning and includes my admin-api branch.

Looks like we'll have to ping-pong between two branches with merge-props since I can't push to your branch.

To post a comment you must log in.
Revision history for this message
Trey Morris (tr3buchet) wrote :

i suppose by approving this in a review it'll allow our branches to merge?

review: Approve
Revision history for this message
Trey Morris (tr3buchet) wrote :

i guess not, i have to do it manually. and mark it as merged somehow

Revision history for this message
Trey Morris (tr3buchet) wrote :

note: you have to click on the foot print looking icon next to the status to update status to merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Authors'
2--- Authors 2010-12-07 21:29:14 +0000
3+++ Authors 2010-12-09 14:59:00 +0000
4@@ -21,8 +21,10 @@
5 Paul Voccio <paul@openstack.org>
6 Rick Clark <rick@openstack.org>
7 Ryan Lucio <rlucio@internap.com>
8+Sandy Walsh <sandy.walsh@rackspace.com>
9 Soren Hansen <soren.hansen@rackspace.com>
10 Todd Willey <todd@ansolabs.com>
11+Trey Morris <trey.morris@rackspace.com>
12 Vishvananda Ishaya <vishvananda@gmail.com>
13 Youcef Laribi <Youcef.Laribi@eu.citrix.com>
14 Zhixue Wu <Zhixue.Wu@citrix.com>
15
16=== modified file 'nova/api/ec2/cloud.py'
17--- nova/api/ec2/cloud.py 2010-12-03 20:21:18 +0000
18+++ nova/api/ec2/cloud.py 2010-12-09 14:59:00 +0000
19@@ -753,7 +753,6 @@
20 ramdisk_id=kwargs.get('ramdisk_id'),
21 display_name=kwargs.get('display_name'),
22 description=kwargs.get('display_description'),
23- user_data=kwargs.get('user_data', ''),
24 key_name=kwargs.get('key_name'),
25 security_group=kwargs.get('security_group'),
26 generate_hostname=internal_id_to_ec2_id)
27
28=== modified file 'nova/api/openstack/__init__.py'
29--- nova/api/openstack/__init__.py 2010-12-02 19:29:37 +0000
30+++ nova/api/openstack/__init__.py 2010-12-09 14:59:00 +0000
31@@ -48,6 +48,10 @@
32 'nova.api.openstack.auth.BasicApiAuthManager',
33 'The auth mechanism to use for the OpenStack API implemenation')
34
35+flags.DEFINE_bool('allow_admin_api',
36+ False,
37+ 'When True, this API service will accept admin operations.')
38+
39
40 class API(wsgi.Middleware):
41 """WSGI entry point for all OpenStack API requests."""
42@@ -183,6 +187,10 @@
43 mapper.resource("sharedipgroup", "sharedipgroups",
44 controller=sharedipgroups.Controller())
45
46+ if FLAGS.allow_admin_api:
47+ logging.debug("Including admin operations in API.")
48+ # TODO: Place routes for admin operations here.
49+
50 super(APIRouter, self).__init__(mapper)
51
52
53
54=== modified file 'nova/compute/api.py'
55--- nova/compute/api.py 2010-12-07 18:06:49 +0000
56+++ nova/compute/api.py 2010-12-09 14:59:00 +0000
57@@ -55,9 +55,8 @@
58
59 def create_instances(self, context, instance_type, image_id, min_count=1,
60 max_count=1, kernel_id=None, ramdisk_id=None,
61- display_name='', description='', user_data='',
62- key_name=None, key_data=None,
63- security_group='default',
64+ display_name='', description='', key_name=None,
65+ key_data=None, security_group='default',
66 generate_hostname=generate_default_hostname):
67 """Create the number of instances requested if quote and
68 other arguments check out ok."""
69@@ -158,8 +157,8 @@
70 {"method": "setup_fixed_ip",
71 "args": {"address": address}})
72
73- logging.debug("Casting to scheduler for %s/%s's instance %s" %
74- (context.project_id, context.user_id, instance_id))
75+ logging.debug("Casting to scheduler for %s/%s's instance %s",
76+ context.project_id, context.user_id, instance_id)
77 rpc.cast(context,
78 FLAGS.scheduler_topic,
79 {"method": "run_instance",
80@@ -169,6 +168,12 @@
81 return instances
82
83 def ensure_default_security_group(self, context):
84+ """ Create security group for the security context if it
85+ does not already exist
86+
87+ :param context: the security context
88+
89+ """
90 try:
91 db.security_group_get_by_name(context, context.project_id,
92 'default')
93@@ -177,7 +182,7 @@
94 'description': 'default',
95 'user_id': context.user_id,
96 'project_id': context.project_id}
97- group = db.security_group_create(context, values)
98+ db.security_group_create(context, values)
99
100 def update_instance(self, context, instance_id, **kwargs):
101 """Updates the instance in the datastore.
102
103=== added file 'nova/tests/api/openstack/test_adminapi.py'
104--- nova/tests/api/openstack/test_adminapi.py 1970-01-01 00:00:00 +0000
105+++ nova/tests/api/openstack/test_adminapi.py 2010-12-09 14:59:00 +0000
106@@ -0,0 +1,61 @@
107+# vim: tabstop=4 shiftwidth=4 softtabstop=4
108+
109+# Copyright 2010 OpenStack LLC.
110+# All Rights Reserved.
111+#
112+# Licensed under the Apache License, Version 2.0 (the "License"); you may
113+# not use this file except in compliance with the License. You may obtain
114+# a copy of the License at
115+#
116+# http://www.apache.org/licenses/LICENSE-2.0
117+#
118+# Unless required by applicable law or agreed to in writing, software
119+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
120+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
121+# License for the specific language governing permissions and limitations
122+# under the License.
123+
124+import unittest
125+
126+import stubout
127+import webob
128+
129+import nova.api
130+from nova import flags
131+from nova.tests.api.openstack import fakes
132+
133+FLAGS = flags.FLAGS
134+
135+
136+class AdminAPITest(unittest.TestCase):
137+ def setUp(self):
138+ self.stubs = stubout.StubOutForTesting()
139+ fakes.FakeAuthManager.auth_data = {}
140+ fakes.FakeAuthDatabase.data = {}
141+ fakes.stub_out_networking(self.stubs)
142+ fakes.stub_out_rate_limiting(self.stubs)
143+ fakes.stub_out_auth(self.stubs)
144+ self.allow_admin = FLAGS.allow_admin_api
145+
146+ def tearDown(self):
147+ self.stubs.UnsetAll()
148+ FLAGS.allow_admin_api = self.allow_admin
149+
150+ def test_admin_enabled(self):
151+ FLAGS.allow_admin_api = True
152+ # We should still be able to access public operations.
153+ req = webob.Request.blank('/v1.0/flavors')
154+ res = req.get_response(nova.api.API('os'))
155+ self.assertEqual(res.status_int, 200)
156+ # TODO: Confirm admin operations are available.
157+
158+ def test_admin_disabled(self):
159+ FLAGS.allow_admin_api = False
160+ # We should still be able to access public operations.
161+ req = webob.Request.blank('/v1.0/flavors')
162+ res = req.get_response(nova.api.API('os'))
163+ self.assertEqual(res.status_int, 200)
164+ # TODO: Confirm admin operations are unavailable.
165+
166+if __name__ == '__main__':
167+ unittest.main()
168
169=== modified file 'tools/pip-requires'
170--- tools/pip-requires 2010-10-25 10:21:09 +0000
171+++ tools/pip-requires 2010-12-09 14:59:00 +0000
172@@ -20,3 +20,4 @@
173 -f http://pymox.googlecode.com/files/mox-0.5.0.tar.gz
174 greenlet==0.3.1
175 nose
176+bzr

Subscribers

People subscribed via source and target branches

to all changes: