mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Sort Options and Outputs in API.txt
Python does not guarantee dict order. Our reliance on it in `makeapi` is technically incorrect, even if it doesn't matter yet in any of our developers' environments. This patch sorts the options by name instead of relying on dict order. As an added benefit, future API.txt diffs should be be neater.
This commit is contained in:
parent
7f27a18b51
commit
fa6be6d8db
5
makeapi
5
makeapi
@ -27,6 +27,7 @@ import sys
|
||||
import os
|
||||
import re
|
||||
import inspect
|
||||
import operator
|
||||
from ipalib import api
|
||||
from ipalib.parameters import Param
|
||||
from ipalib.output import Output
|
||||
@ -206,9 +207,9 @@ def make_api():
|
||||
fd.write('args: %d,%d,%d\n' % (len(cmd.args), len(cmd.options), len(cmd.output)))
|
||||
for a in cmd.args():
|
||||
fd.write('arg: %s\n' % param_repr(a))
|
||||
for o in cmd.options():
|
||||
for o in sorted(cmd.options(), key=operator.attrgetter('name')):
|
||||
fd.write('option: %s\n' % param_repr(o))
|
||||
for o in cmd.output():
|
||||
for o in sorted(cmd.output(), key=operator.attrgetter('name')):
|
||||
fd.write('output: %s\n' % param_repr(o))
|
||||
fd.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user