Imported Debian patch 4.0.5-6~numeezy

This commit is contained in:
Alexandre Ellert
2016-02-17 15:07:45 +01:00
committed by Mario Fetka
parent c44de33144
commit 10dfc9587b
1203 changed files with 53869 additions and 241462 deletions

View File

@@ -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)