Commit 364082b
fix: don't use lexical sorting for version numbers in codegen
Previously, python-libjuju iterated over schemas keyed by their version
string (e.g. '3.1.9') using lexical sorting. For a given facade version,
a definition in a higher versioned schema was intended to overwrite any
prior definition saved (see generate_facades function in facade.py).
With lexical sorting, '3.1.10' would be sorted in between '3.1.1' and
'3.1.2', which would not lead to the desired behaviour. This commit
fixes this problem by using a tuple of integers as the sorting key. A
special case is requried for the version string 'latest', and we use
(9000, 9000, 9000).1 parent c58ec9d commit 364082b
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | | - | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
930 | 941 | | |
931 | 942 | | |
932 | 943 | | |
933 | | - | |
| 944 | + | |
934 | 945 | | |
935 | 946 | | |
936 | 947 | | |
| |||
0 commit comments