def to_dict(self):
        d = {}
        for prop in ['ip', 'hostname', 'public_ip', 'public_hostname',
                     'master', 'node', 'master_lb', 'storage', 'containerized',
                     'connect_to', 'preconfigured', 'new_host']:
            # If the property is defined (not None or False), export it:
            if getattr(self, prop):
                d[prop] = getattr(self, prop)
        return d
Used when exporting to yaml.
dataset/ETHPy150Open openshift/openshift-ansible/utils/src/ooinstall/oo_config.py/Host.to_dict