Merge lp:~julian-edwards/maas/1.2-start-node-error-bug-1069603 into lp:maas/1.2

Proposed by Julian Edwards on 2012-10-29
Status: Merged
Approved by: Julian Edwards on 2012-10-29
Approved revision: 1274
Merged at revision: 1274
Proposed branch: lp:~julian-edwards/maas/1.2-start-node-error-bug-1069603
Merge into: lp:maas/1.2
Diff against target: 34 lines (+9/-1)
1 file modified
src/metadataserver/api.py (+9/-1)
To merge this branch: bzr merge lp:~julian-edwards/maas/1.2-start-node-error-bug-1069603
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve on 2012-10-29
Review via email: mp+131855@code.launchpad.net

Commit message

Prevent an unnecessary stack trace in the metadataserver log when starting a node that has no user data.

To post a comment you must log in.
Julian Edwards (julian-edwards) wrote :

Self-approving trunk backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/metadataserver/api.py'
2--- src/metadataserver/api.py 2012-10-04 22:02:51 +0000
3+++ src/metadataserver/api.py 2012-10-29 10:48:20 +0000
4@@ -18,6 +18,9 @@
5 'VersionIndexHandler',
6 ]
7
8+import httplib
9+from logging import getLogger
10+
11 from django.conf import settings
12 from django.core.exceptions import PermissionDenied
13 from django.http import HttpResponse
14@@ -57,6 +60,9 @@
15 from piston.utils import rc
16
17
18+logger = getLogger("metadataserver")
19+
20+
21 class UnknownMetadataVersion(MAASAPINotFound):
22 """Not a known metadata version."""
23
24@@ -327,7 +333,9 @@
25 NodeUserData.objects.get_user_data(node),
26 mimetype='application/octet-stream')
27 except NodeUserData.DoesNotExist:
28- raise MAASAPINotFound("No user data available for this node.")
29+ logger.info(
30+ "No user data registered for node named %s" % node.hostname)
31+ return HttpResponse(status=httplib.NOT_FOUND)
32
33
34 class EnlistMetaDataHandler(OperationsHandler):

Subscribers

People subscribed via source and target branches

to status/vote changes: