Show More
@@ -142,7 +142,7 def api_call(apikey, apihost, format, me | |||||
142 |
|
142 | |||
143 | if not method: |
|
143 | if not method: | |
144 | raise Exception('please specify method name !') |
|
144 | raise Exception('please specify method name !') | |
145 |
id_ = random.randrange(1, |
|
145 | id_ = random.randrange(1, 9999) | |
146 | req = urllib2.Request('%s/_admin/api' % apihost, |
|
146 | req = urllib2.Request('%s/_admin/api' % apihost, | |
147 | data=json.dumps(_build_data(id_)), |
|
147 | data=json.dumps(_build_data(id_)), | |
148 | headers={'content-type': 'text/plain'}) |
|
148 | headers={'content-type': 'text/plain'}) | |
@@ -221,6 +221,8 def main(argv=None): | |||||
221 | apikey = args.apikey or conf['apikey'] |
|
221 | apikey = args.apikey or conf['apikey'] | |
222 | host = args.apihost or conf['apihost'] |
|
222 | host = args.apihost or conf['apihost'] | |
223 | method = args.method |
|
223 | method = args.method | |
|
224 | if method == '_create_config': | |||
|
225 | sys.exit() | |||
224 | margs = dict(map(lambda s: s.split(':', 1), other)) |
|
226 | margs = dict(map(lambda s: s.split(':', 1), other)) | |
225 |
|
227 | |||
226 | api_call(apikey, host, args.format, method, **margs) |
|
228 | api_call(apikey, host, args.format, method, **margs) |
General Comments 0
You need to be logged in to leave comments.
Login now