'Main execution path'

def __init__(self):

    self.conn = None
    self.inventory = dict()
    self.cache = dict()
    self.read_settings()
    self.parse_cli_args()
    if self.args.refresh_cache:
        self.update_cache()
    elif (not self.is_cache_valid()):
        self.update_cache()
    else:
        self.load_inventory_from_cache()
        self.load_cache_from_cache()
    data_to_print = ''
    if self.args.host:
        data_to_print += self.get_host_info()
    else:
        self.inventory['_meta'] = {'hostvars': {}}
        for hostname in self.cache:
            self.inventory['_meta']['hostvars'][hostname] = {'cobbler': self.cache[hostname]}
        data_to_print += self.json_format_dict(self.inventory, True)
    print data_to_print
