If ordinal isn't specified, put the new tool at the end of the existing tools. (You'll have to change the default ordinal=0 to ordinal=None, for starters)
this code prevents multiple mounts from all being assigned the ordinal 0 by making the default be to pick an ordinal one greater than the largest existing ordinal, thus, by default installing a new mount at the end
The upshot is, the mounts for a new project as created on a sandbox, or for a project created by an import script, that the mounts will be numbered in sequence with no duplication (annoying to test, I know)
code on forge:wo/2252
see notes in [#2252]
this code prevents multiple mounts from all being assigned the ordinal 0 by making the default be to pick an ordinal one greater than the largest existing ordinal, thus, by default installing a new mount at the end
The upshot is, the mounts for a new project as created on a sandbox, or for a project created by an import script, that the mounts will be numbered in sequence with no duplication (annoying to test, I know)
Related
Tickets:
#2252