#!/usr/bin/env python3
#
# Participant list generator for 'netreach' task spec
#
# Input is a test spec, assumed to have been validated by spec-is-valid.
#
# Output is a list of hostnames or IPs that are participating.
#

import pscheduler
import sys


json = pscheduler.json_load(exit_on_error=True)

null_reason = None

# Only one participant
host = json.get('host-node', json.get('host', None))
if host is None:
    null_reason = "No host specified"


participants = [ host ]

result = { "participants": participants }
if null_reason is not None:
    result["null-reason"] = null_reason

pscheduler.succeed_json(result)
