def write_hostnames(save_path, hostnames_ips):
 file_path = dir_find(save_path)
 hostnames_ip_file = os.path.join(file_path, 'openstack_hostnames_ips.yml')
 with open(hostnames_ip_file, 'wb') as f:
  f.write(json.dumps(hostnames_ips, indent=4, sort_keys=True))

def write_hostnames ( save_path , hostnames_ips ) : file_path = dir_find ( save_path ) hostnames_ip_file = os . path . join ( file_path , 'openstack_hostnames_ips.yml' ) with open ( hostnames_ip_file , 'wb' ) as f : f . write ( json . dumps ( hostnames_ips , indent = 4 , sort_keys = True ) )
write a list of all hosts and their given ip addresses note: the file is saved in json format to a file with the name openstack_hostnames_ips .