'Main execution path'

def __init__(self):

    self.inventory = dict()
    self.hosts = dict()
    self.parse_cli_args()
    self.read_settings()
    if (self.args.refresh_cache or (not self.is_cache_valid())):
        self.update_cache()
    else:
        self.load_inventory_from_cache()
        self.load_hosts_from_cache()
    data_to_print = ''
    if self.args.host:
        if self.args.debug:
            print(('Fetching    host    [%s]' % self.args.host))
        data_to_print += self.get_host_info(self.args.host)
    else:
        self.inventory['_meta'] = {'hostvars': {}}
        for hostname in self.hosts:
            self.inventory['_meta']['hostvars'][hostname] = {'cloudforms': self.hosts[hostname]}
            if ('ansible_ssh_host' in self.hosts[hostname]):
                self.inventory['_meta']['hostvars'][hostname]['ansible_ssh_host'] = self.hosts[hostname]['ansible_ssh_host']
        data_to_print += self.json_format_dict(self.inventory, self.args.pretty)
    print(data_to_print)
