summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mock-meta.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/mock-meta.py b/tools/mock-meta.py
index d4677af6..0f13acd6 100755
--- a/tools/mock-meta.py
+++ b/tools/mock-meta.py
@@ -6,10 +6,11 @@
import functools
import httplib
+import json
import logging
-import sys
-import string
import random
+import string
+import sys
import yaml
from optparse import OptionParser
@@ -88,6 +89,8 @@ PLACEMENT_CAPABILITIES = {
'availability-zone': AVAILABILITY_ZONES,
}
+NOT_IMPL_RESPONSE = json.dumps({})
+
class WebException(Exception):
def __init__(self, code, msg):
@@ -181,7 +184,11 @@ class MetaDataHandler(object):
else:
return "%s" % (PLACEMENT_CAPABILITIES.get(pentry, ''))
else:
- return '{}'
+ log.warn(("Did not implement action %s, "
+ "returning empty response: %r"),
+ action, NOT_IMPL_RESPONSE)
+ return NOT_IMPL_RESPONSE
+
class UserDataHandler(object):