Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -17,26 +17,29 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ipaserver.install.plugins import MIDDLE
|
||||
from ipaserver.install.plugins.baseupdate import PostUpdate
|
||||
from ipalib import api, errors
|
||||
from ipalib import Updater
|
||||
from ipapython.dn import DN
|
||||
|
||||
|
||||
class update_pacs(Updater):
|
||||
class update_pacs(PostUpdate):
|
||||
"""
|
||||
Includes default nfs:None only if no nfs: PAC present in ipakrbauthzdata.
|
||||
"""
|
||||
|
||||
order = MIDDLE
|
||||
|
||||
def execute(self, **options):
|
||||
ldap = self.api.Backend.ldap2
|
||||
ldap = self.obj.backend
|
||||
|
||||
try:
|
||||
dn = DN('cn=ipaConfig', 'cn=etc', self.api.env.basedn)
|
||||
dn = DN('cn=ipaConfig', 'cn=etc', api.env.basedn)
|
||||
entry = ldap.get_entry(dn, ['ipakrbauthzdata'])
|
||||
pacs = entry.get('ipakrbauthzdata', [])
|
||||
except errors.NotFound:
|
||||
self.log.warning('Error retrieving: %s' % str(dn))
|
||||
return False, []
|
||||
return (False, False, [])
|
||||
|
||||
nfs_pac_set = any(pac.startswith('nfs:') for pac in pacs)
|
||||
|
||||
@@ -49,6 +52,6 @@ class update_pacs(Updater):
|
||||
else:
|
||||
self.log.debug('PAC for nfs is already set, not adding nfs:NONE.')
|
||||
|
||||
return False, []
|
||||
return (False, False, [])
|
||||
|
||||
api.register(update_pacs)
|
||||
|
||||
Reference in New Issue
Block a user