~smoser/cloud-init/azure_dhcp

« back to all changes in this revision

Viewing changes to tools/mock-meta.py

  • Committer: Joshua Harlow
  • Date: 2012-06-25 19:28:04 UTC
  • mto: (559.2.405 cloud-init)
  • mto: This revision was merged to the branch mainline in revision 564.
  • Revision ID: harlowja@yahoo-inc.com-20120625192804-c7doi5biprvu3qpk
Add warning when hitting a unknown api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import functools
8
8
import httplib
 
9
import json
9
10
import logging
 
11
import random
 
12
import string
10
13
import sys
11
 
import string
12
 
import random
13
14
import yaml
14
15
 
15
16
from optparse import OptionParser
88
89
    'availability-zone': AVAILABILITY_ZONES,
89
90
}
90
91
 
 
92
NOT_IMPL_RESPONSE = json.dumps({})
 
93
 
91
94
 
92
95
class WebException(Exception):
93
96
    def __init__(self, code, msg):
181
184
                else:
182
185
                    return "%s" % (PLACEMENT_CAPABILITIES.get(pentry, ''))
183
186
        else:
184
 
            return '{}'
 
187
            log.warn(("Did not implement action %s, "
 
188
                      "returning empty response: %r"),
 
189
                      action, NOT_IMPL_RESPONSE)
 
190
            return NOT_IMPL_RESPONSE
 
191
 
185
192
 
186
193
class UserDataHandler(object):
187
194