def checkSNLength(cfgDict, pmgr):
    """ 
    Function that checks to make sure the SN in the configuration dictionary is
    9 digits long. Issues have come up becasue leading zeros get dropped 
    somewhere along the pipeline. It will return a corrected configuration 
    dictionary if the SN length is wrong, and return the same one if it is fine.
    """

    # Make sure it is a string
    cfgDict["FLD_SN"] = str(cfgDict["FLD_SN"])
    
    SN = cfgDict["FLD_SN"]
    try:
        # Continue adding 0s until the SN is the correct length
        while len(cfgDict["FLD_SN"]) < 9:
            cfgDict["FLD_SN"] = "0" + cfgDict["FLD_SN"]
        return cfgDict

    # If it fails in any way just return the dictionary
    except:
        print("Failed to check SN")
        return cfgDict