Bug 34180

Summary: Output should be sorted by property names
Product: UCS Reporter: Philipp Hahn <hahn>
Component: UDM - CLIAssignee: Johannes Keiser <keiser>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: enhancement    
Priority: P5 CC: best, gohmann
Version: UCS 4.2Flags: hahn: Patch_Available+
Target Milestone: UCS 4.2-1-errata   
Hardware: All   
OS: Linux   
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?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Usability
Max CVSS v3 score:

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>