diff options
author | 2017-08-31 02:32:05 +0200 | |
---|---|---|
committer | 2017-09-03 04:27:00 +0200 | |
commit | 1b89628e4571a65245a743e4a85d38438a119b3d (patch) | |
tree | 6b31ac6ab1d5e2197cf2e922ae317d8db237e303 /build/select_closest_fuel_mirror.py | |
parent | 98f171c82636c29a9cfd5c94c8e7aac7ca7af41b (diff) |
build, deploy: Remove obsolete Fuel@Openstack code
JIRA: FUEL-278
Change-Id: I30c04c325de5ac97aee172386de43201988646c5
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'build/select_closest_fuel_mirror.py')
-rwxr-xr-x | build/select_closest_fuel_mirror.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/build/select_closest_fuel_mirror.py b/build/select_closest_fuel_mirror.py deleted file mode 100755 index 0fdc69eac..000000000 --- a/build/select_closest_fuel_mirror.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# stefan.k.berg@ericsson.com -# jonas.bjurel@ericsson.com -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -# Select closest fuel mirror based on latency measured with ping. -# Failsafe: The us1 mirror - -from subprocess import Popen,PIPE -import re -from operator import itemgetter - -mirrors = [ "us1", "cz1" ] -FNULL = open('/dev/null', 'w') -try: - re_avg = re.compile(r'.* = [^/]*/([^/]*).*') - - pingtime = {} - for mirror in mirrors: - fqdn = "mirror.seed-"+mirror+".fuel-infra.org" - pingtime[fqdn] = 0 - pipe = Popen("ping -c 3 " + fqdn + " | tail -1",shell = True, stdout=PIPE, stderr=FNULL) - avg = pipe.communicate()[0] - pipe.stdout.close() - pingtime[fqdn] = float(re_avg.split(avg)[1]) - - print sorted(pingtime.items(), key=itemgetter(1))[0][0] -except: - print "mirror.seed-"+mirrors[0]+".fuel-infra.org" |