After looking at the whole thing, this line can be pulled up above the `if datastore['MOF_UPLOAD_METHOD']` check.