diff options
author | alexv-smirnov <[email protected]> | 2023-03-28 22:25:04 +0300 |
---|---|---|
committer | alexv-smirnov <[email protected]> | 2023-03-28 22:25:04 +0300 |
commit | b8a17f9b1c166d2e9a26b99348a4c29d972caf55 (patch) | |
tree | 1a2d881f1a9452b9c6103dbf69d73da7624e98e5 /build/scripts/fetch_resource.py | |
parent | 25659221f18577ea38430a8ec3349836f5626b6a (diff) |
Revert ymake build from ydb oss export
Diffstat (limited to 'build/scripts/fetch_resource.py')
-rw-r--r-- | build/scripts/fetch_resource.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/build/scripts/fetch_resource.py b/build/scripts/fetch_resource.py deleted file mode 100644 index d5af311e5d8..00000000000 --- a/build/scripts/fetch_resource.py +++ /dev/null @@ -1,43 +0,0 @@ -import urllib2 -import argparse -import xmlrpclib - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('-r', '--resource-id', type=int, required=True) - parser.add_argument('-o', '--output', required=True) - return parser.parse_args() - - -def fetch(url, retries=4, timeout=5): - for i in xrange(retries): - try: - return urllib2.urlopen(url, timeout=timeout).read() - - except Exception: - if i + 1 < retries: - continue - - else: - raise - - -def fetch_resource(id_): - urls = xmlrpclib.ServerProxy("https://sandbox.yandex-team.ru/sandbox/xmlrpc").get_resource_http_links(id_) - - for u in urls: - try: - return fetch(u) - - except Exception: - continue - - raise Exception('Cannot fetch resource {}'.format(id_)) - - -if __name__ == '__main__': - args = parse_args() - - with open(args.output, 'wb') as f: - f.write(fetch_resource(int(args.resource_id))) |