Merge lp:~reldan/nova/lp766240 into lp:~hudson-openstack/nova/trunk

Proposed by Eldar Nugaev
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1004
Merged at revision: 1017
Proposed branch: lp:~reldan/nova/lp766240
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 45 lines (+9/-6)
1 file modified
nova/api/openstack/servers.py (+9/-6)
To merge this branch: bzr merge lp:~reldan/nova/lp766240
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Devin Carlen (community) Approve
Review via email: mp+58352@code.launchpad.net

Commit message

fix logging in reboot OpenStack API

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

nice work

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

lgtm

review: Approve
Revision history for this message
Eldar Nugaev (reldan) wrote :

Could you please change status from needs review to approve?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/openstack/servers.py'
2--- nova/api/openstack/servers.py 2011-04-18 23:36:04 +0000
3+++ nova/api/openstack/servers.py 2011-04-19 17:31:39 +0000
4@@ -40,7 +40,7 @@
5 from nova.scheduler import api as scheduler_api
6
7
8-LOG = logging.getLogger('server')
9+LOG = logging.getLogger('nova.api.openstack.servers')
10 FLAGS = flags.FLAGS
11
12
13@@ -331,6 +331,7 @@
14 return exc.HTTPAccepted()
15
16 def _action_rebuild(self, input_dict, req, id):
17+ LOG.debug(_("Rebuild server action is not implemented"))
18 return faults.Fault(exc.HTTPNotImplemented())
19
20 def _action_resize(self, input_dict, req, id):
21@@ -346,18 +347,20 @@
22 except Exception, e:
23 LOG.exception(_("Error in resize %s"), e)
24 return faults.Fault(exc.HTTPBadRequest())
25- return faults.Fault(exc.HTTPAccepted())
26+ return exc.HTTPAccepted()
27
28 def _action_reboot(self, input_dict, req, id):
29- try:
30+ if 'reboot' in input_dict and 'type' in input_dict['reboot']:
31 reboot_type = input_dict['reboot']['type']
32- except Exception:
33- raise faults.Fault(exc.HTTPNotImplemented())
34+ else:
35+ LOG.exception(_("Missing argument 'type' for reboot"))
36+ return faults.Fault(exc.HTTPUnprocessableEntity())
37 try:
38 # TODO(gundlach): pass reboot_type, support soft reboot in
39 # virt driver
40 self.compute_api.reboot(req.environ['nova.context'], id)
41- except:
42+ except Exception, e:
43+ LOG.exception(_("Error in reboot %s"), e)
44 return faults.Fault(exc.HTTPUnprocessableEntity())
45 return exc.HTTPAccepted()
46