|
|
e3ffab |
From 4acf45785f917bb52382202279d5931469198f26 Mon Sep 17 00:00:00 2001
|
|
|
e3ffab |
From: Tomas Babej <tbabej@redhat.com>
|
|
|
e3ffab |
Date: Tue, 2 Dec 2014 15:40:40 +0100
|
|
|
e3ffab |
Subject: [PATCH] hosts: Display assigned ID view by default in host-find and
|
|
|
e3ffab |
show commands
|
|
|
e3ffab |
|
|
|
e3ffab |
Makes ipaassignedidview a default attribute and takes care about the
|
|
|
e3ffab |
conversion from the DN to the proper ID view name.
|
|
|
e3ffab |
|
|
|
e3ffab |
https://fedorahosted.org/freeipa/ticket/4774
|
|
|
e3ffab |
|
|
|
e3ffab |
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
|
|
|
e3ffab |
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
|
|
|
e3ffab |
---
|
|
|
e3ffab |
API.txt | 6 +++---
|
|
|
e3ffab |
VERSION | 4 ++--
|
|
|
e3ffab |
install/ui/src/freeipa/host.js | 1 -
|
|
|
e3ffab |
ipalib/plugins/host.py | 21 ++++++++++++++++++---
|
|
|
e3ffab |
4 files changed, 23 insertions(+), 9 deletions(-)
|
|
|
e3ffab |
|
|
|
e3ffab |
diff --git a/API.txt b/API.txt
|
|
|
e3ffab |
index e9768bf1e87d6679c439b98ed696b720937099d2..7949c49f9fb9e3cd7eceb64a05dd8e550eb48f8b 100644
|
|
|
e3ffab |
--- a/API.txt
|
|
|
e3ffab |
+++ b/API.txt
|
|
|
e3ffab |
@@ -1793,7 +1793,7 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui
|
|
|
e3ffab |
option: Str('description', attribute=True, cli_name='desc', multivalue=False, required=False)
|
|
|
e3ffab |
option: Flag('force', autofill=True, default=False)
|
|
|
e3ffab |
option: Str('ip_address?')
|
|
|
e3ffab |
-option: DNParam('ipaassignedidview', attribute=True, cli_name='ipaassignedidview', multivalue=False, required=False)
|
|
|
e3ffab |
+option: Str('ipaassignedidview', attribute=True, cli_name='ipaassignedidview', multivalue=False, required=False)
|
|
|
e3ffab |
option: Bool('ipakrbokasdelegate', attribute=False, cli_name='ok_as_delegate', multivalue=False, required=False)
|
|
|
e3ffab |
option: Bool('ipakrbrequirespreauth', attribute=False, cli_name='requires_pre_auth', multivalue=False, required=False)
|
|
|
e3ffab |
option: Str('ipasshpubkey', attribute=True, cli_name='sshpubkey', csv=True, multivalue=True, required=False)
|
|
|
e3ffab |
@@ -1909,7 +1909,7 @@ option: Str('in_hostgroup*', cli_name='in_hostgroups', csv=True)
|
|
|
e3ffab |
option: Str('in_netgroup*', cli_name='in_netgroups', csv=True)
|
|
|
e3ffab |
option: Str('in_role*', cli_name='in_roles', csv=True)
|
|
|
e3ffab |
option: Str('in_sudorule*', cli_name='in_sudorules', csv=True)
|
|
|
e3ffab |
-option: DNParam('ipaassignedidview', attribute=True, autofill=False, cli_name='ipaassignedidview', multivalue=False, query=True, required=False)
|
|
|
e3ffab |
+option: Str('ipaassignedidview', attribute=True, autofill=False, cli_name='ipaassignedidview', multivalue=False, query=True, required=False)
|
|
|
e3ffab |
option: Str('l', attribute=True, autofill=False, cli_name='locality', multivalue=False, query=True, required=False)
|
|
|
e3ffab |
option: Str('macaddress', attribute=True, autofill=False, cli_name='macaddress', csv=True, multivalue=True, pattern='^([a-fA-F0-9]{2}[:|\\-]?){5}[a-fA-F0-9]{2}$', query=True, required=False)
|
|
|
e3ffab |
option: Str('man_by_host*', cli_name='man_by_hosts', csv=True)
|
|
|
e3ffab |
@@ -1945,7 +1945,7 @@ option: Str('addattr*', cli_name='addattr', exclude='webui')
|
|
|
e3ffab |
option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui')
|
|
|
e3ffab |
option: Str('delattr*', cli_name='delattr', exclude='webui')
|
|
|
e3ffab |
option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, required=False)
|
|
|
e3ffab |
-option: DNParam('ipaassignedidview', attribute=True, autofill=False, cli_name='ipaassignedidview', multivalue=False, required=False)
|
|
|
e3ffab |
+option: Str('ipaassignedidview', attribute=True, autofill=False, cli_name='ipaassignedidview', multivalue=False, required=False)
|
|
|
e3ffab |
option: Bool('ipakrbokasdelegate', attribute=False, autofill=False, cli_name='ok_as_delegate', multivalue=False, required=False)
|
|
|
e3ffab |
option: Bool('ipakrbrequirespreauth', attribute=False, autofill=False, cli_name='requires_pre_auth', multivalue=False, required=False)
|
|
|
e3ffab |
option: Str('ipasshpubkey', attribute=True, autofill=False, cli_name='sshpubkey', csv=True, multivalue=True, required=False)
|
|
|
e3ffab |
diff --git a/VERSION b/VERSION
|
|
|
e3ffab |
index bfbce5604e79008afd2893e406c634718159b1e9..196be85e83de96f501352ca93f2c7ed6876ea641 100644
|
|
|
e3ffab |
--- a/VERSION
|
|
|
e3ffab |
+++ b/VERSION
|
|
|
e3ffab |
@@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
|
|
|
e3ffab |
# #
|
|
|
e3ffab |
########################################################
|
|
|
e3ffab |
IPA_API_VERSION_MAJOR=2
|
|
|
e3ffab |
-IPA_API_VERSION_MINOR=110
|
|
|
e3ffab |
-# Last change: pvoborni - allow to retrieve keytab by hosts
|
|
|
e3ffab |
+IPA_API_VERSION_MINOR=112
|
|
|
e3ffab |
+# Last change: tbabej - change ipaassignedidview to Str
|
|
|
e3ffab |
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
|
|
|
e3ffab |
index 455ff8f50ec58104d4e046ec0fabf2a7e89eeeb2..1120c82e708f20081ee9ec5f5c1b4c349d101b15 100644
|
|
|
e3ffab |
--- a/install/ui/src/freeipa/host.js
|
|
|
e3ffab |
+++ b/install/ui/src/freeipa/host.js
|
|
|
e3ffab |
@@ -117,7 +117,6 @@ return {
|
|
|
e3ffab |
name: 'ipaassignedidview',
|
|
|
e3ffab |
$type: 'link',
|
|
|
e3ffab |
label: '@i18n:objects.idview.ipaassignedidview',
|
|
|
e3ffab |
- ui_formatter: 'dn',
|
|
|
e3ffab |
other_entity: 'idview'
|
|
|
e3ffab |
}
|
|
|
e3ffab |
]
|
|
|
e3ffab |
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
|
|
|
e3ffab |
index 39a7d3c25b9cb56fca486b2500da5fe7bd4a6fbc..41710f3b87b5f60ac6e9b0765a25562b7074e2e8 100644
|
|
|
e3ffab |
--- a/ipalib/plugins/host.py
|
|
|
e3ffab |
+++ b/ipalib/plugins/host.py
|
|
|
e3ffab |
@@ -22,7 +22,7 @@ from nss.error import NSPRError
|
|
|
e3ffab |
import string
|
|
|
e3ffab |
|
|
|
e3ffab |
from ipalib import api, errors, util
|
|
|
e3ffab |
-from ipalib import Str, Flag, Bytes, DNParam
|
|
|
e3ffab |
+from ipalib import Str, Flag, Bytes
|
|
|
e3ffab |
from ipalib.plugable import Registry
|
|
|
e3ffab |
from ipalib.plugins.baseldap import (LDAPQuery, LDAPObject, LDAPCreate,
|
|
|
e3ffab |
LDAPDelete, LDAPUpdate, LDAPSearch,
|
|
|
e3ffab |
@@ -162,6 +162,17 @@ def update_sshfp_record(zone, record, entry_attrs):
|
|
|
e3ffab |
except errors.EmptyModlist:
|
|
|
e3ffab |
pass
|
|
|
e3ffab |
|
|
|
e3ffab |
+
|
|
|
e3ffab |
+def convert_ipaassignedidview_post(entry_attrs, options):
|
|
|
e3ffab |
+ """
|
|
|
e3ffab |
+ Converts the ID View DN to its name for the better looking output.
|
|
|
e3ffab |
+ """
|
|
|
e3ffab |
+
|
|
|
e3ffab |
+ if 'ipaassignedidview' in entry_attrs and not options.get('raw'):
|
|
|
e3ffab |
+ idview_name = entry_attrs.single_value['ipaassignedidview'][0].value
|
|
|
e3ffab |
+ entry_attrs.single_value['ipaassignedidview'] = idview_name
|
|
|
e3ffab |
+
|
|
|
e3ffab |
+
|
|
|
e3ffab |
host_output_params = (
|
|
|
e3ffab |
Flag('has_keytab',
|
|
|
e3ffab |
label=_('Keytab'),
|
|
|
e3ffab |
@@ -286,7 +297,7 @@ class host(LDAPObject):
|
|
|
e3ffab |
'fqdn', 'description', 'l', 'nshostlocation', 'krbprincipalname',
|
|
|
e3ffab |
'nshardwareplatform', 'nsosversion', 'usercertificate', 'memberof',
|
|
|
e3ffab |
'managedby', 'memberindirect', 'memberofindirect', 'macaddress',
|
|
|
e3ffab |
- 'userclass', 'ipaallowedtoperform'
|
|
|
e3ffab |
+ 'userclass', 'ipaallowedtoperform', 'ipaassignedidview',
|
|
|
e3ffab |
]
|
|
|
e3ffab |
uuid_attribute = 'ipauniqueid'
|
|
|
e3ffab |
attribute_members = {
|
|
|
e3ffab |
@@ -513,7 +524,8 @@ class host(LDAPObject):
|
|
|
e3ffab |
doc=_('Host category (semantics placed on this attribute are for '
|
|
|
e3ffab |
'local interpretation)'),
|
|
|
e3ffab |
),
|
|
|
e3ffab |
- DNParam('ipaassignedidview?',
|
|
|
e3ffab |
+ Str('ipaassignedidview?',
|
|
|
e3ffab |
+ label=_('Assigned ID View'),
|
|
|
e3ffab |
flags=['no_option'],
|
|
|
e3ffab |
),
|
|
|
e3ffab |
) + ticket_flags_params
|
|
|
e3ffab |
@@ -949,6 +961,7 @@ class host_mod(LDAPUpdate):
|
|
|
e3ffab |
self.obj.suppress_netgroup_memberof(ldap, entry_attrs)
|
|
|
e3ffab |
|
|
|
e3ffab |
convert_sshpubkey_post(ldap, dn, entry_attrs)
|
|
|
e3ffab |
+ convert_ipaassignedidview_post(entry_attrs, options)
|
|
|
e3ffab |
|
|
|
e3ffab |
return dn
|
|
|
e3ffab |
|
|
|
e3ffab |
@@ -1035,6 +1048,7 @@ class host_find(LDAPSearch):
|
|
|
e3ffab |
entry_attrs['managing'] = self.obj.get_managed_hosts(entry_attrs.dn)
|
|
|
e3ffab |
|
|
|
e3ffab |
convert_sshpubkey_post(ldap, entry_attrs.dn, entry_attrs)
|
|
|
e3ffab |
+ convert_ipaassignedidview_post(entry_attrs, options)
|
|
|
e3ffab |
|
|
|
e3ffab |
return truncated
|
|
|
e3ffab |
|
|
|
e3ffab |
@@ -1070,6 +1084,7 @@ class host_show(LDAPRetrieve):
|
|
|
e3ffab |
self.obj.suppress_netgroup_memberof(ldap, entry_attrs)
|
|
|
e3ffab |
|
|
|
e3ffab |
convert_sshpubkey_post(ldap, dn, entry_attrs)
|
|
|
e3ffab |
+ convert_ipaassignedidview_post(entry_attrs, options)
|
|
|
e3ffab |
|
|
|
e3ffab |
return dn
|
|
|
e3ffab |
|
|
|
e3ffab |
--
|
|
|
e3ffab |
2.1.0
|
|
|
e3ffab |
|