mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Move version.py to the common ipa directory instead of being server-based so it can be used by the client tool.
Fix the client tool imports to fail more gracefully.
This commit is contained in:
parent
5a56b7c885
commit
c58b7a3d7c
6
Makefile
6
Makefile
@ -104,9 +104,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
|
||||
sed s/__VERSION__/$(IPA_VERSION)/ ipa-python/version.py.in \
|
||||
> ipa-python/version.py
|
||||
perl -pi -e "s:__NUM_VERSION__:$(IPA_VERSION_MAJOR)$(IPA_VERSION_MINOR)$(IPA_VERSION_RELEASE):" ipa-python/version.py
|
||||
|
||||
archive:
|
||||
-mkdir -p dist
|
||||
|
@ -19,10 +19,32 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
VERSION = "%prog .1"
|
||||
try:
|
||||
import sys
|
||||
|
||||
import os
|
||||
import krbV
|
||||
import socket
|
||||
import logging
|
||||
from optparse import OptionParser
|
||||
import ipaclient.ipadiscovery
|
||||
import ipaclient.ipachangeconf
|
||||
import ipaclient.ntpconf
|
||||
from ipa.ipautil import run
|
||||
from ipa import sysrestore
|
||||
from ipa import version
|
||||
except ImportError:
|
||||
print >> sys.stderr, """\
|
||||
There was a problem importing one of the required Python modules. The
|
||||
error was:
|
||||
|
||||
%s
|
||||
""" % sys.exc_value
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def parse_options():
|
||||
parser = OptionParser(version=VERSION)
|
||||
parser = OptionParser(version=version.VERSION)
|
||||
parser.add_option("--domain", dest="domain", help="domain name")
|
||||
parser.add_option("--server", dest="server", help="IPA server")
|
||||
parser.add_option("--realm", dest="realm_name", help="realm name")
|
||||
@ -371,19 +393,9 @@ def main():
|
||||
return 0
|
||||
|
||||
try:
|
||||
import sys
|
||||
|
||||
import os
|
||||
import krbV
|
||||
import socket
|
||||
import logging
|
||||
from optparse import OptionParser
|
||||
import ipaclient.ipadiscovery
|
||||
import ipaclient.ipachangeconf
|
||||
import ipaclient.ntpconf
|
||||
from ipa.ipautil import run
|
||||
from ipa import sysrestore
|
||||
|
||||
sys.exit(main())
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
except SystemExit, e:
|
||||
sys.exit(e)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
|
@ -13,7 +13,7 @@ install:
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -f *~ *.pyc setup.py ipa-python.spec
|
||||
rm -f *~ *.pyc setup.py ipa-python.spec version.py
|
||||
|
||||
distclean: clean
|
||||
|
||||
|
@ -22,4 +22,4 @@ 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__"
|
||||
NUM_VERSION=__NUM_VERSION__
|
@ -44,7 +44,7 @@ import ipaserver.httpinstance
|
||||
import ipaserver.ntpinstance
|
||||
|
||||
from ipaserver import service
|
||||
from ipaserver import version
|
||||
from ipa import version
|
||||
from ipaserver.installutils import *
|
||||
|
||||
from ipa import sysrestore
|
||||
|
@ -13,7 +13,6 @@ app_PYTHON = \
|
||||
installutils.py \
|
||||
replication.py \
|
||||
certs.py \
|
||||
version.py \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
|
@ -26,7 +26,7 @@ import ipaserver.dsinstance
|
||||
import ipaserver.ipaldap
|
||||
import copy
|
||||
from ipaserver import attrs
|
||||
from ipaserver import version
|
||||
from ipa import version
|
||||
from ipa import ipaerror
|
||||
from ipa import ipautil
|
||||
from urllib import quote,unquote
|
||||
@ -386,8 +386,8 @@ class IPAServer:
|
||||
# Higher-level API
|
||||
def version(self, opts=None):
|
||||
"""The version of IPA"""
|
||||
logging.debug("IPA: version %d" % ipaserver.version.NUM_VERSION)
|
||||
return ipaserver.version.NUM_VERSION
|
||||
logging.debug("IPA: version %d" % version.NUM_VERSION)
|
||||
return version.NUM_VERSION
|
||||
|
||||
def get_aci_entry(self, sattrs, opts=None):
|
||||
"""Returns the entry containing access control ACIs."""
|
||||
|
Loading…
Reference in New Issue
Block a user