def _service(inactive, completed, is_json): """List dcos services :param inactive: If True, include completed tasks :type inactive: bool :param is_json: If true, output json. Otherwise, output a human readable table. :type is_json: bool :returns: process return code :rtype: int """ services = mesos.get_master().frameworks( inactive=inactive, completed=completed) if is_json: emitter.publish([service.dict() for service in services]) else: table = tables.service_table(services) output = str(table) if output: emitter.publish(output) return 0
def _service(inactive, completed, is_json): """List dcos services :param inactive: If True, include completed tasks :type inactive: bool :param is_json: If true, output json. Otherwise, output a human readable table. :type is_json: bool :returns: process return code :rtype: int """ services = mesos.get_master().frameworks( inactive=inactive, completed=completed) if is_json: emitter.publish([service.dict() for service in services]) else: table = tables.service_table(services) output = six.text_type(table) if output: emitter.publish(output) return 0