# Whenever we update the Node information dictionary version and format, we 
# must update the shim. A given shim is specific to a target dictionary 
# version. It must be in a well known location and so be easily extractable 
# from an install.tar. It must be fully backward compatible to the earliest 
# OneFS version joinable (with upgrade) to a cluster running the OneFS version 
# the shim came from, and should be backwards compatible all the way back to 
# OneFS v5.5 (Scotch Bonnet) if at all possible. It must provide a method 
# gather_shim_info() which returns a node info dictionary sufficient for the 
# corresponding check_join(), check_upgrade(), and check_reimage() functions 
# in the checker.

# The shim will likely work by running the native gather_node_info() method, 
# checking the Dictionary Version field, and running a series of 
# upgrade_dictionary_from_n_to_n+1() functions(n being some dictionary version 
# number) until the dictionary is at the target version. 

# As we currently have only one dictionary version, we simply gather and return
# the result. 
def gather_shim_info(gatherer):
    mydict = gatherer.gather_node_info()
    if mydict["dictionary version"]["number"] < 1:
        mydict["dictionary version"]["number"] = 1
    mydict["gathered with shim"] = True
    return mydict

