Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 304873 Details for
Bug 435019
mechanism for negotiating version in XML-RPC requests
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
API to let the server know what version it is
freeipa-15-version.patch (text/plain), 7.88 KB, created by
Rob Crittenden
on 2008-05-08 15:46:57 UTC
(
hide
)
Description:
API to let the server know what version it is
Filename:
MIME Type:
Creator:
Rob Crittenden
Created:
2008-05-08 15:46:57 UTC
Size:
7.88 KB
patch
obsolete
>From 7e0ab33a1073bc12e96685cd8afd49f8ccb199ec Mon Sep 17 00:00:00 2001 >From: Rob Crittenden <rcritten@redhat.com> >Date: Thu, 8 May 2008 11:45:38 -0400 >Subject: [PATCH] Add a version API to the server so it knows what version it is. > >435019 >--- > Makefile | 4 +++- > ipa-server/ipa-install/ipa-replica-install | 3 ++- > ipa-server/ipa-install/ipa-replica-manage | 18 +++++++++--------- > ipa-server/ipa-install/ipa-replica-prepare | 3 ++- > ipa-server/ipa-install/ipa-server-install | 5 ++--- > ipa-server/ipaserver/Makefile.am | 1 + > ipa-server/ipaserver/version.py.in | 25 +++++++++++++++++++++++++ > ipa-server/xmlrpc-server/funcs.py | 5 +++++ > ipa-server/xmlrpc-server/ipaxmlrpc.py | 1 + > 9 files changed, 50 insertions(+), 15 deletions(-) > create mode 100644 ipa-server/ipaserver/version.py.in > >diff --git a/Makefile b/Makefile >index 9e6fb35..c50b546 100644 >--- a/Makefile >+++ b/Makefile >@@ -103,7 +103,9 @@ version-update: > > ipa-server/selinux/ipa-server-selinux.spec > sed s/VERSION/$(IPA_VERSION)/ ipa-python/setup.py.in \ > > ipa-python/setup.py >- >+ sed s/__VERSION__/$(IPA_VERSION)/ ipa-server/ipaserver/version.py.in \ >+ > ipa-server/ipaserver/version.py >+ perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" ipa-server/ipaserver/version.py > > archive: > -mkdir -p dist >diff --git a/ipa-server/ipa-install/ipa-replica-install b/ipa-server/ipa-install/ipa-replica-install >index 551b468..1a9144c 100644 >--- a/ipa-server/ipa-install/ipa-replica-install >+++ b/ipa-server/ipa-install/ipa-replica-install >@@ -28,6 +28,7 @@ from ipa import ipautil > > from ipaserver import dsinstance, replication, installutils, krbinstance, service > from ipaserver import httpinstance, ntpinstance, certs, ipaldap >+from ipaserver import version > > class ReplicaConfig: > def __init__(self): >@@ -41,7 +42,7 @@ class ReplicaConfig: > > def parse_options(): > from optparse import OptionParser >- parser = OptionParser() >+ parser = OptionParser(version=version.VERSION) > parser.add_option("-N", "--no-ntp", dest="conf_ntp", action="store_false", > help="do not configure ntp", default=True) > parser.add_option("-d", "--debug", dest="debug", action="store_true", >diff --git a/ipa-server/ipa-install/ipa-replica-manage b/ipa-server/ipa-install/ipa-replica-manage >index dd58907..28aceeb 100644 >--- a/ipa-server/ipa-install/ipa-replica-manage >+++ b/ipa-server/ipa-install/ipa-replica-manage >@@ -17,11 +17,19 @@ > # along with this program; if not, write to the Free Software > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > # >+import sys >+ >+import getpass, ldap, re, krbV >+import traceback, logging >+ >+from ipa import ipautil >+from ipaserver import replication, ipaldap, dsinstance, installutils >+from ipaserver import version > > def parse_options(): > from optparse import OptionParser > >- parser = OptionParser() >+ parser = OptionParser(version=version.VERSION) > parser.add_option("-H", "--host", dest="host", help="starting host") > parser.add_option("-p", "--password", dest="dirman_passwd", help="Directory Manager password") > parser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False, >@@ -138,14 +146,6 @@ def main(): > synch_master(r, args[1]) > > try: >- import sys >- >- import getpass, ldap, re, krbV >- import traceback, logging >- >- from ipa import ipautil >- from ipaserver import replication, ipaldap, dsinstance, installutils >- > main() > except KeyboardInterrupt: > sys.exit(1) >diff --git a/ipa-server/ipa-install/ipa-replica-prepare b/ipa-server/ipa-install/ipa-replica-prepare >index 81a98f1..4090ad8 100644 >--- a/ipa-server/ipa-install/ipa-replica-prepare >+++ b/ipa-server/ipa-install/ipa-replica-prepare >@@ -29,6 +29,7 @@ from optparse import OptionParser > import ipa.config > from ipa import ipautil > from ipaserver import dsinstance, installutils, certs, ipaldap >+from ipaserver import version > import ldap > > def usage(): >@@ -36,7 +37,7 @@ def usage(): > sys.exit(1) > > def parse_options(): >- parser = OptionParser() >+ parser = OptionParser(version=version.VERSION) > > args = ipa.config.init_config(sys.argv) > options, args = parser.parse_args(args) >diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install >index 09fba19..e1cca39 100644 >--- a/ipa-server/ipa-install/ipa-server-install >+++ b/ipa-server/ipa-install/ipa-server-install >@@ -24,8 +24,6 @@ > # openldap-clients > # nss-tools > >-VERSION = "%prog .1" >- > import sys > import os > import socket >@@ -46,13 +44,14 @@ import ipaserver.httpinstance > import ipaserver.ntpinstance > > from ipaserver import service >+from ipaserver import version > from ipaserver.installutils import * > > from ipa import sysrestore > from ipa.ipautil import * > > def parse_options(): >- parser = OptionParser(version=VERSION) >+ parser = OptionParser(version=version.VERSION) > parser.add_option("-u", "--user", dest="ds_user", > help="ds user") > parser.add_option("-r", "--realm", dest="realm_name", >diff --git a/ipa-server/ipaserver/Makefile.am b/ipa-server/ipaserver/Makefile.am >index 13029e1..e124f6b 100644 >--- a/ipa-server/ipaserver/Makefile.am >+++ b/ipa-server/ipaserver/Makefile.am >@@ -13,6 +13,7 @@ app_PYTHON = \ > installutils.py \ > replication.py \ > certs.py \ >+ version.py \ > $(NULL) > > EXTRA_DIST = \ >diff --git a/ipa-server/ipaserver/version.py.in b/ipa-server/ipaserver/version.py.in >new file mode 100644 >index 0000000..b0b53f4 >--- /dev/null >+++ b/ipa-server/ipaserver/version.py.in >@@ -0,0 +1,25 @@ >+# Authors: Rob Crittenden <rcritten@redhat.com> >+# >+# Copyright (C) 2007 Red Hat >+# see file 'COPYING' for use and warranty information >+# >+# This program is free software; you can redistribute it and/or >+# modify it under the terms of the GNU General Public License as >+# published by the Free Software Foundation; version 2 only >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with this program; if not, write to the Free Software >+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA >+# >+ >+# The full version including strings >+VERSION="__VERSION__" >+ >+# Just the numeric portion of the version so one can do direct numeric >+# comparisons to see if the API is compatible. >+NUM_VERSION="__NUM_VERSION__" >diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py >index 74a3030..a077885 100644 >--- a/ipa-server/xmlrpc-server/funcs.py >+++ b/ipa-server/xmlrpc-server/funcs.py >@@ -26,6 +26,7 @@ import ipaserver.dsinstance > import ipaserver.ipaldap > import copy > from ipaserver import attrs >+from ipaserver import version > from ipa import ipaerror > from ipa import ipautil > from urllib import quote,unquote >@@ -383,6 +384,10 @@ class IPAServer: > return True > > # Higher-level API >+ def version(self, opts=None): >+ """The version of IPA""" >+ logging.debug("IPA: version") >+ return ipaserver.version.NUM_VERSION > > def get_aci_entry(self, sattrs, opts=None): > """Returns the entry containing access control ACIs.""" >diff --git a/ipa-server/xmlrpc-server/ipaxmlrpc.py b/ipa-server/xmlrpc-server/ipaxmlrpc.py >index 95f2352..4e2ad35 100644 >--- a/ipa-server/xmlrpc-server/ipaxmlrpc.py >+++ b/ipa-server/xmlrpc-server/ipaxmlrpc.py >@@ -324,6 +324,7 @@ def handler(req, profiling=False): > try: > f = funcs.IPAServer() > h = ModXMLRPCRequestHandler() >+ h.register_function(f.version) > h.register_function(f.get_aci_entry) > h.register_function(f.get_entry_by_dn) > h.register_function(f.get_entry_by_cn) >-- >1.5.3.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435019
: 304873