コード例 #1
0
ファイル: __init__.py プロジェクト: encukou/freeipa
def get_package(api):
    if api.env.in_tree:
        # pylint: disable=import-error,ipa-forbidden-import
        from ipaserver import plugins
        # pylint: enable=import-error,ipa-forbidden-import
    else:
        try:
            plugins = api._remote_plugins
        except AttributeError:
            server_info = ServerInfo(api)

            client = rpcclient(api)
            client.finalize()

            try:
                plugins = schema.get_package(server_info, client)
            except schema.NotAvailable:
                plugins = compat.get_package(server_info, client)
            finally:
                if client.isconnected():
                    client.disconnect()

            object.__setattr__(api, '_remote_plugins', plugins)

    return plugins
コード例 #2
0
ファイル: __init__.py プロジェクト: stanislavlevin/freeipa
def get_package(api):
    if api.env.in_tree:
        # pylint: disable=import-error,ipa-forbidden-import
        from ipaserver import plugins
        # pylint: enable=import-error,ipa-forbidden-import
    else:
        try:
            plugins = api._remote_plugins
        except AttributeError:
            server_info = ServerInfo(api)

            client = rpcclient(api)
            client.finalize()

            try:
                plugins = schema.get_package(server_info, client)
            except schema.NotAvailable:
                plugins = compat.get_package(server_info, client)
            finally:
                if client.isconnected():
                    client.disconnect()

            object.__setattr__(api, '_remote_plugins', plugins)

    return plugins
コード例 #3
0
ファイル: __init__.py プロジェクト: guanwei/freeipa
def get_package(api):
    if api.env.in_tree:
        from ipaserver import plugins
    else:
        client = rpcclient(api)
        client.finalize()
        try:
            plugins = schema.get_package(api, client)
        except schema.NotAvailable:
            plugins = compat.get_package(api, client)
        finally:
            if client.isconnected():
                client.disconnect()

    return plugins