Imported Debian patch 4.0.5-6~numeezy
This commit is contained in:
committed by
Mario Fetka
parent
c44de33144
commit
10dfc9587b
@@ -42,12 +42,6 @@ from ipalib import Str
|
||||
from ipalib import output
|
||||
|
||||
|
||||
# To make the example ready for Python 3, we alias "unicode" to strings.
|
||||
import six
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
|
||||
# We're going to create an example command plugin, that takes a name as its
|
||||
# only argument. Commands in IPA support input validation by defining
|
||||
# functions we're going to call 'validators'. This is an example of such
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from __future__ import print_function
|
||||
from ipalib import api
|
||||
|
||||
# 1. Initialize ipalib
|
||||
@@ -38,11 +37,13 @@ api.finalize()
|
||||
# Backend.ldap.connect(), otherwise Backend.rpcclient.connect().
|
||||
|
||||
if api.env.in_server:
|
||||
api.Backend.ldap2.connect()
|
||||
api.Backend.ldap2.connect(
|
||||
ccache=api.Backend.krb.default_ccname()
|
||||
)
|
||||
else:
|
||||
api.Backend.rpcclient.connect()
|
||||
|
||||
|
||||
# Now that you're connected, you can make calls to api.Command.whatever():
|
||||
print('The admin user:')
|
||||
print(api.Command.user_show(u'admin'))
|
||||
print 'The admin user:'
|
||||
print api.Command.user_show(u'admin')
|
||||
|
||||
@@ -752,9 +752,9 @@ def run(api):
|
||||
except KeyboardInterrupt:
|
||||
print ''
|
||||
api.log.info('operation aborted')
|
||||
except PublicError as e:
|
||||
except PublicError, e:
|
||||
error = e
|
||||
except Exception as e:
|
||||
except StandardError, e:
|
||||
api.log.exception('%s: %s', e.__class__.__name__, str(e))
|
||||
error = InternalError()
|
||||
if error is not None:
|
||||
|
||||
@@ -13,7 +13,7 @@ env._finalize_core(**dict(DEFAULT_CONFIG))
|
||||
api.bootstrap(context='server', debug=env.debug, log=None) (ref:wsgi-app-bootstrap)
|
||||
try:
|
||||
api.finalize() (ref:wsgi-app-finalize)
|
||||
except Exception as e:
|
||||
except StandardError, e:
|
||||
api.log.error('Failed to start IPA: %s' % e)
|
||||
else:
|
||||
api.log.info('*** PROCESS START ***')
|
||||
|
||||
Reference in New Issue
Block a user