diff options
author | shadchin <shadchin@yandex-team.com> | 2025-02-28 07:22:17 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2025-02-28 07:36:55 +0300 |
commit | 5581d11ad7e3cf76f13a2698ed2d2a8df2fa11c4 (patch) | |
tree | bd1d554a1b3f556d8e5ed6909fb2060232706bc1 /build | |
parent | 8ee64ccc1e66602863ae412eed2ae3ceebdd3db9 (diff) | |
download | ydb-5581d11ad7e3cf76f13a2698ed2d2a8df2fa11c4.tar.gz |
Get rid of `fetch_resource`
commit_hash:a255d4fa7a32b82f2213a87fba245054b9cb65a1
Diffstat (limited to 'build')
-rw-r--r-- | build/scripts/fetch_resource.py | 43 | ||||
-rw-r--r-- | build/scripts/ya.make | 1 |
2 files changed, 0 insertions, 44 deletions
diff --git a/build/scripts/fetch_resource.py b/build/scripts/fetch_resource.py deleted file mode 100644 index d5af311e5d..0000000000 --- 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))) diff --git a/build/scripts/ya.make b/build/scripts/ya.make index e59871172b..165a8da6db 100644 --- a/build/scripts/ya.make +++ b/build/scripts/ya.make @@ -16,7 +16,6 @@ IF (PY2) fetch_from_archive.py fetch_from_mds.py fetch_from_sandbox.py - fetch_resource.py gen_java_codenav_entry.py gen_py3_reg.py go_tool.py |