def collect_storage_host(hosts):
 message = '\nSetting up high-availability masters requires a storage host. Please provide a\nhost that will be configured as a Registry Storage.\n\nNote: Containerized storage hosts are not currently supported.\n'
 click.echo(message)
 host_props = {}
 first_master = next((host for host in hosts if host.is_master()))
 hostname_or_ip = click.prompt('Enter hostname or IP address', value_proc=validate_prompt_hostname, default=first_master.connect_to)
 (existing, existing_host) = is_host_already_node_or_master(hostname_or_ip, hosts)
 if (existing and existing_host.is_node()):
  existing_host.roles.append('storage')
 else:
  host_props['connect_to'] = hostname_or_ip
  host_props['preconfigured'] = False
  host_props['roles'] = ['storage']
  storage = Host(**host_props)
  hosts.append(storage)

def collect_storage_host ( hosts ) : message = '\nSetting up high-availability masters requires a storage host. Please provide a\nhost that will be configured as a Registry Storage.\n\nNote: Containerized storage hosts are not currently supported.\n' click . echo ( message ) host_props = { } first_master = next ( ( host for host in hosts if host . is_master ( ) ) ) hostname_or_ip = click . prompt ( 'Enter hostname or IP address' , value_proc = validate_prompt_hostname , default = first_master . connect_to ) ( existing , existing_host ) = is_host_already_node_or_master ( hostname_or_ip , hosts ) if ( existing and existing_host . is_node ( ) ) : existing_host . roles . append ( 'storage' ) else : host_props [ 'connect_to' ] = hostname_or_ip host_props [ 'preconfigured' ] = False host_props [ 'roles' ] = [ 'storage' ] storage = Host ( ** host_props ) hosts . append ( storage )
get a valid host for storage from the user and append it to the list of hosts .