Bug 21585 - udm cli gibt die mit Richtlinien verknüpften Objekte nicht aus
udm cli gibt die mit Richtlinien verknüpften Objekte nicht aus
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 4.0-1-errata
Assigned To: Philipp Hahn
Janek Walkenhorst
:
: 28634 (view as bug list)
Depends on:
Blocks: 33232
  Show dependency treegraph
 
Reported: 2011-02-15 11:31 CET by Arvid Requate
Modified: 2015-03-25 16:43 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
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:
Ticket number:
Bug group (optional):
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 Arvid Requate univentionstaff 2011-02-15 11:31:33 CET
udm cli gibt die mit Richtlinien verknüpften Objekte nicht aus, _view_referencing_objects scheint immer None zu sein.

root@qamaster:/# udm policies/pwhistory list 

DN: cn=default-settings,cn=pwhistory,cn=users,cn=policies,dc=ucs24i386,dc=qa
ARG: None
  name: default-settings
  emptyAttributes: None
  filler: None
  prohibitedObjectClasses: None
  requiredObjectClasses: None
  length: 3
  _view_referencing_objects: None
  expiryInterval: None
  fixedAttributes: None
  pwQualityCheck: None
  pwLength: 8
Comment 1 Philipp Hahn univentionstaff 2013-11-08 10:09:34 CET
# udm --help | grep -B2 -A1 policies
list options:
  --filter                         Lookup filter e.g. foo=bar
  --policies                       List policy-based settings:
                                   0:short, 1:long (with policy-DN)
does not work.

# grep -n 'policies\>' /usr/share/pyshared/univention/admincli/admin.py 
123:    out.append('  --%-30s %s' % ('policies', 'List policy-based settings:'))
438:    longopts=['position=', 'dn=', 'arg=', 'set=', 'append=', 'remove=', 'superordinate=', 'option=', 'append-option=', 'filter=', 'tls=', 'ignore_exists', 'logfile=', 'policies=', 'binddn=', 'bindpwd=', 'bindpwdfile=', 'customattribute=', 'customattribute-remove=','policy-reference=','policy-dereference=','remove_referring','recursive']
456:    list_policies=False
478:            elif opt == '--policies':
479:                    policies = True
1152:                           if list_policies:

# sed -i -e '479s/policies/list_&/' /usr/share/pyshared/univention/admincli/admin.py

# udm dhcp/service list --policies 0
DN: cn=phahn.dev,cn=dhcp,dc=phahn,dc=dev
ARG: None
  service: phahn.dev
  univentionPolicyReference: cn=Only PHahn DHCP,cn=scope,cn=dhcp,cn=policies,dc=phahn,dc=dev
  Policy-based Settings:
    univentionDhcpDomainName="phahn.dev"
    univentionDhcpDomainNameServers="192.168.0.135"
    univentionDesktopProfile="/usr/share/univention-kde-profiles/kde4-menu"
    univentionDesktopProfile="/usr/share/univention-kde-profiles/ucs-3.0"
    univentionDhcpBootServer="192.168.0.135"
    univentionDhcpBootFilename="pxelinux.0"
    univentionFileServer="xen12.phahn.dev"
    univentionFileServer="xen15.phahn.dev"
    univentionFileServer="olb85.phahn.dev"
    univentionDhcpRouters="10.200.17.1"
    univentionPWLength="8"
    univentionPWHistoryLen="3"
    univentionDhcpUnknownClients="ignore"
Comment 2 Philipp Hahn univentionstaff 2013-11-11 09:30:25 CET
*** Bug 28634 has been marked as a duplicate of this bug. ***
Comment 3 Philipp Hahn univentionstaff 2013-11-29 15:31:30 CET
tree 3c3a8d143d5cb436e7ad37cca1466ab843b5784d
parent edfd429dd602b8c37a4aeecdcbdf1474b08096b2
author Philipp Hahn <hahn@univention.de> Fri Nov 29 09:49:01 2013 +0100
committer Philipp Hahn <hahn@univention.de> Fri Nov 29 12:49:02 2013 +0100

Bug #21585: Fix listing policy references

Rename and set variable "policies" -> "list_policies".

diff --git a/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admincli/admin.py b/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admincli/admin.py
index 1607760..24d7ba7 100755
--- a/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admincli/admin.py
+++ b/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admincli/admin.py
@@ -476,7 +476,7 @@ def _doit(arglist):
 		elif opt == '--logfile':
 			logfile=val
 		elif opt == '--policies':
-			policies = True
+			list_policies = True
 			if val=="1":
 				policies_with_DN = True
 			else:
Comment 4 Philipp Hahn univentionstaff 2014-02-06 10:58:56 CET
again
Comment 5 Philipp Hahn univentionstaff 2015-03-17 14:22:12 CET
r59102 | Bug #21585 UDM: Repair --policies option
 Fix one line

Package: univention-directory-manager-modules
Version: 10.0.29-33.1297.201503171311
Branch: ucs_4.0-0
Scope: errata4.0-1

r59114 | Bug #21585 UDM: Repair --policies option YAML
 2015-03-13-univention-directory-manager-modules.yaml

QA:
udm users/user list --policies 0 > /tmp/before
sed -i -e '479s/policies/list_&/' /usr/share/pyshared/univention/admincli/admin.py
pkill -f /usr/share/univention-directory-manager-tools/univention-cli-server
udm users/user list --policies 0 > /tmp/after
diff -u /tmp/before /tmp/after 
--- /tmp/before 2015-03-11 02:51:45.002079000 +0100
+++ /tmp/after  2015-03-11 02:54:37.198079000 +0100
@@ -70,6 +70,13 @@
   CtxCfgClientDrivers: 0
   CtxCfgTSLogon: 1
   univentionPolicyReference: cn=default-admins,cn=admin-settings,cn=users,cn=policies,dc=qa,dc=intranet
+  Policy-based Settings:
+    univentionPWLength="8"
+    univentionPWHistoryLen="3"
+    univentionDhcpDomainName="qa.intranet"
+    univentionDhcpDomainNameServers="10.200.17.62"
+    univentionAdminMayOverrideSettings="1"
+
 
 DN: uid=join-backup,cn=users,dc=qa,dc=intranet
 ARG: None
@@ -142,6 +149,15 @@
   mailPrimaryAddress: None
   CtxCfgClientDrivers: 0
   CtxCfgTSLogon: 1
+  Policy-based Settings:
+    univentionAdminMayOverrideSettings="0"
+    univentionAdminListWebModules="modself"
+    univentionAdminListWizards="None"
+    univentionPWLength="8"
+    univentionPWHistoryLen="3"
+    univentionDhcpDomainName="qa.intranet"
+    univentionDhcpDomainNameServers="10.200.17.62"
+
 
 DN: uid=join-slave,cn=users,dc=qa,dc=intranet
 ARG: None
@@ -212,6 +228,15 @@
   mailPrimaryAddress: None
   CtxCfgClientDrivers: 0
   CtxCfgTSLogon: 1
+  Policy-based Settings:
+    univentionAdminMayOverrideSettings="0"
+    univentionAdminListWebModules="modself"
+    univentionAdminListWizards="None"
+    univentionPWLength="8"
+    univentionPWHistoryLen="3"
+    univentionDhcpDomainName="qa.intranet"
+    univentionDhcpDomainNameServers="10.200.17.62"
+
 
 DN: uid=test,dc=qa,dc=intranet
 ARG: None
@@ -220,4 +245,13 @@
   objectFlag: None
   username: test
   description: None
+  Policy-based Settings:
+    univentionAdminMayOverrideSettings="0"
+    univentionAdminListWebModules="modself"
+    univentionAdminListWizards="None"
+    univentionPWLength="8"
+    univentionPWHistoryLen="3"
+    univentionDhcpDomainName="qa.intranet"
+    univentionDhcpDomainNameServers="10.200.17.62"
+
Comment 6 Janek Walkenhorst univentionstaff 2015-03-24 09:28:02 CET
Code review: OK
Tests: OK
Advisory: OK
Comment 7 Janek Walkenhorst univentionstaff 2015-03-25 16:43:34 CET
<http://errata.univention.de/ucs/4.0/122.html>