eoptasks: remove all digits to get cluster name
This commit is contained in:
parent
5e506bcbd4
commit
cdc4dbc666
|
@ -286,8 +286,10 @@ if pid:
|
|||
os.system('tmux attach-session -t %s' % tmux_session_name)
|
||||
else:
|
||||
def cluster_name(server_name):
|
||||
return re.match(r'(.*?)(\d*)$', server_name).group(1).replace(
|
||||
'.rbx.', '.loc.').replace('.gra.', '.loc.').replace('.sbg.', '.loc.')
|
||||
cluster_name = re.sub(r'\d', '', server_name)
|
||||
for location in ('rbx', 'gra', 'sbg'):
|
||||
cluster_name = cluster_name.replace('.%s.' % location, '.loc')
|
||||
return cluster_name
|
||||
|
||||
tmux = libtmux.Server()
|
||||
session = tmux.find_where({'session_name': tmux_session_name})
|
||||
|
|
Loading…
Reference in New Issue