Skip to content

Commit

Permalink
change marathon group parsing method
Browse files Browse the repository at this point in the history
fixes Difrex#9
  • Loading branch information
w1r0x committed Dec 6, 2016
1 parent 9a439fb commit dec5e79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Denis Zheleztsov <difrex.punk@gmail.com>
Denis Ryabyy <vv1r0x@gmail.com>
14 changes: 4 additions & 10 deletions surok/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit dec5e79

Please # to comment.