From dec5e790c7c804ba09f8419744f49e6e6182def2 Mon Sep 17 00:00:00 2001 From: w1r0x Date: Tue, 6 Dec 2016 12:11:01 +0300 Subject: [PATCH] change marathon group parsing method fixes difrex/surok#9 --- AUTHORS | 1 + surok/discovery.py | 14 ++++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index eb5bc7a..a720639 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1,2 @@ Denis Zheleztsov +Denis Ryabyy diff --git a/surok/discovery.py b/surok/discovery.py index 0e7b747..4f93da5 100644 --- a/surok/discovery.py +++ b/surok/discovery.py @@ -89,13 +89,7 @@ def get_group(service, app): # Return marathon.group def parse_marathon_app_id(marathon_app_id): marathon_app_id = marathon_app_id.split('/') - group = '' - counter = len(marathon_app_id) - 2 - i = 0 - while counter > i: - group = group + marathon_app_id[counter] - if counter != i + 1: - group += '.' - counter -= 1 - - return group + del(marathon_app_id[-1]) + marathon_app_id.reverse() + group = ".".join(marathon_app_id)[:-1] + return(group)