mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
remove apache python script from commit
This commit is contained in:
parent
97a581954f
commit
9a78355390
1 changed files with 0 additions and 24 deletions
|
|
@ -1,24 +0,0 @@
|
|||
#! /usr/bin/env python
|
||||
|
||||
import sys, argparse
|
||||
from urllib2 import urlopen
|
||||
from json import loads
|
||||
|
||||
|
||||
class UsageOnErrorParser(argparse.ArgumentParser):
|
||||
def error(self, message):
|
||||
sys.stderr.write('argument error: %s\n' % message)
|
||||
self.print_help()
|
||||
sys.exit(2)
|
||||
|
||||
parser = UsageOnErrorParser(description='Print preferred Apache mirror URL.')
|
||||
parser.add_argument('url', type=str, help='Apache mirror selector url.')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
jsonurl = args.url + '&asjson=1'
|
||||
|
||||
body = urlopen(jsonurl).read().decode('utf-8')
|
||||
mirrors = loads(body)
|
||||
print(mirrors['preferred'] + mirrors['path_info'])
|
||||
|
||||
Loading…
Reference in a new issue