Bug 34180 - Output should be sorted by property names
Output should be sorted by property names
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 4.2
All Linux
: P5 enhancement (vote)
: UCS 4.2-1-errata
Assigned To: Johannes Keiser
Florian Best
:
: 39579 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-21 19:05 CET by Philipp Hahn
Modified: 2017-07-05 13:06 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number:
Bug group (optional): Usability
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-02-21 19:05:18 CET
The properties in the output of "udm $MODULE list" are not sorted, which makes it hard to find a specific one, as udm-cli does not provide a native display filter and "grep" is too complex when multiple entries are shown:

udm settings/extended_attribute list --filter name=objectFlag | sed -ne '/^DN:/,/^$/s/:.*//p;' | uniq
DN
  translationLongDescription
  objectClass
  groupPosition
  module
  overwritePosition
  hook
  overwriteTab
  shortDescription
  groupName
  version
  valueRequired
  CLIName
  translationShortDescription
  fullWidth
  longDescription
  doNotSearch
  tabName
  syntax
  tabAdvanced
  name
  default
  mayChange
  multivalue
  ldapMapping
  deleteObjectClass
  notEditable
  tabPosition
  disableUDMWeb

/usr/share/pyshared/univention/admincli/admin.py:1131
-              for key, value in object.items():
+              for key, value in sorted(object.items()):
Comment 1 Philipp Hahn univentionstaff 2015-10-21 11:53:45 CEST
*** Bug 39579 has been marked as a duplicate of this bug. ***
Comment 2 Florian Best univentionstaff 2016-09-24 14:47:43 CEST
I stumble on this sometimes. This is why I avoid using UDM and use ldapsearch directly. One-line patch exists.
Comment 3 Florian Best univentionstaff 2016-11-05 03:38:11 CET
I think the identifies=True properties should be shown first.
Comment 4 Johannes Keiser univentionstaff 2017-07-03 12:20:41 CEST
(In reply to Philipp Hahn from comment #0)

> /usr/share/pyshared/univention/admincli/admin.py:1131
> -              for key, value in object.items():
> +              for key, value in sorted(object.items()):

Applied patch:

r 80760
univention-directory-manager-modules (12.0.17-47) 
* Bug #34180: Applied patch from Philipp Hahn - Sort properties of
udm list output

YAML: r 80761
Comment 5 Florian Best univentionstaff 2017-07-03 12:38:45 CEST
OK: output is sorted and looks good
OK: YAML
Comment 6 Janek Walkenhorst univentionstaff 2017-07-05 13:06:10 CEST
<http://errata.software-univention.de/ucs/4.2/79.html>