- User wants to run a DC/OS integration test which requires just a master node
- User creates a cluster with just a master node
- User sets the MASTER_HOSTS, SLAVE_HOSTS, PUBLIC_SLAVE_HOSTS environment variables.
- User sees:
Exception: This cluster is set to wait for hosts, however, not all host lists were supplied. Please set all three environment variables of MASTER_HOSTS, SLAVE_HOSTS, and PUBLIC_SLAVE_HOSTS to the appropriate cluster IPs (comma separated). Alternatively, set WAIT_FOR_HOSTS=false in the environment to use whichever hosts are currently registered.
I believe that the error is in the following code:
masters = os.getenv('MASTER_HOSTS')
slaves = os.getenv('SLAVE_HOSTS')
public_slaves = os.getenv('PUBLIC_SLAVE_HOSTS')
'dcos_url': os.getenv('DCOS_DNS_ADDRESS', 'http: 'masters': masters.split(',') if masters else None,
'slaves': slaves.split(',') if slaves else None,
'public_slaves': public_slaves.split(',') if public_slaves else None}
For each of the keys which refer to roles, e.g. slaves, if slaves is falsy if os.environ['SLAVE_HOSTS'] == ''.
Instead, the logic could be slaves.split(',') if slaves is not None else None.