launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #13837
[Merge] lp:~julian-edwards/maas/start-node-error-bug-1069603 into lp:maas
Julian Edwards has proposed merging lp:~julian-edwards/maas/start-node-error-bug-1069603 into lp:maas.
Commit message:
Prevent an unnecessary stack trace in the metadataserver log when starting a node that has no user data.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~julian-edwards/maas/start-node-error-bug-1069603/+merge/131848
--
https://code.launchpad.net/~julian-edwards/maas/start-node-error-bug-1069603/+merge/131848
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/maas/start-node-error-bug-1069603 into lp:maas.
=== modified file 'src/metadataserver/api.py'
--- src/metadataserver/api.py 2012-10-04 22:02:51 +0000
+++ src/metadataserver/api.py 2012-10-29 10:25:29 +0000
@@ -18,6 +18,9 @@
'VersionIndexHandler',
]
+import httplib
+from logging import getLogger
+
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
@@ -57,6 +60,9 @@
from piston.utils import rc
+logger = getLogger("metadataserver")
+
+
class UnknownMetadataVersion(MAASAPINotFound):
"""Not a known metadata version."""
@@ -327,7 +333,9 @@
NodeUserData.objects.get_user_data(node),
mimetype='application/octet-stream')
except NodeUserData.DoesNotExist:
- raise MAASAPINotFound("No user data available for this node.")
+ logger.info(
+ "No user data for node named %s was found" % node.hostname)
+ return HttpResponse(status=httplib.NOT_FOUND)
class EnlistMetaDataHandler(OperationsHandler):