def execute(self): apps = flat_list(map(lambda marathon: marathon.apps_by_id_pattern(self.marathon_app_id), marathons)) if len(apps) > 1: return 'More than one app found: {0}. Please choose the one you are interested.'.format(', '.join(map(lambda app: app.id, apps))) marathon_app = apps[0] return '\n'.join(map(lambda t: self.exec_sh_on_task(marathon_app, t), marathon_app.tasks))
def find_apps_by_id_patterns(patterns): return flat_list(map(lambda m: m.apps_by_id_patterns(patterns), marathons))
def apps_by_id_patterns(self, patterns): return flat_list(map(lambda p: self.apps_by_id_pattern(p), patterns))