Changeset - 02fc6ce0cd44
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-06-25 23:08:06
marcin@python-works.com
don't make a api call after doing create_config
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/bin/rhodecode_api.py
Show inline comments
 
@@ -139,13 +139,13 @@ def api_call(apikey, apihost, format, me
 
            "method": method,
 
            "args": kw
 
        }
 

	
 
    if not method:
 
        raise Exception('please specify method name !')
 
    id_ = random.randrange(1, 200)
 
    id_ = random.randrange(1, 9999)
 
    req = urllib2.Request('%s/_admin/api' % apihost,
 
                      data=json.dumps(_build_data(id_)),
 
                      headers={'content-type': 'text/plain'})
 
    if format == FORMAT_PRETTY:
 
        sys.stdout.write('calling %s to %s \n' % (req.get_data(), apihost))
 
    ret = urllib2.urlopen(req)
 
@@ -218,12 +218,14 @@ def main(argv=None):
 
                parser.error('Could not find config file and missing '
 
                             '--apikey or --apihost in params')
 

	
 
    apikey = args.apikey or conf['apikey']
 
    host = args.apihost or conf['apihost']
 
    method = args.method
 
    if method == '_create_config':
 
        sys.exit()
 
    margs = dict(map(lambda s: s.split(':', 1), other))
 

	
 
    api_call(apikey, host, args.format, method, **margs)
 
    return 0
 

	
 
if __name__ == '__main__':
0 comments (0 inline, 0 general)