summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorGabe <redhatrises@gmail.com>2014-06-06 06:39:59 -0600
committerPetr Viktorin <pviktori@redhat.com>2014-06-09 16:27:41 +0200
commit2a8c509567754877ed0188784d7c38250484be48 (patch)
treef7c9427bb8c6c6e134cd3ae0af62abee96589a06 /ipalib
parentec282c7e96090f25bae4747e2e586af54bf49720 (diff)
downloadfreeipa-2a8c509567754877ed0188784d7c38250484be48.tar.gz
freeipa-2a8c509567754877ed0188784d7c38250484be48.tar.xz
freeipa-2a8c509567754877ed0188784d7c38250484be48.zip
Add version and API version
- Add API version to constants.py - Add version option to plugable.py - Add version to ipa manpage and fix a couple of typos https://fedorahosted.org/freeipa/ticket/4316 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/constants.py4
-rw-r--r--ipalib/plugable.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/constants.py b/ipalib/constants.py
index e98eee6f8..2269189f4 100644
--- a/ipalib/constants.py
+++ b/ipalib/constants.py
@@ -23,7 +23,8 @@ All constants centralised in one file.
"""
import socket
from ipapython.dn import DN
-from ipapython.version import VERSION
+from ipapython.version import VERSION, API_VERSION
+
try:
FQDN = socket.getfqdn()
except:
@@ -65,6 +66,7 @@ CONFIG_SECTION = 'global'
# This is a tuple instead of a dict so that it is immutable.
# To create a dict with this config, just "d = dict(DEFAULT_CONFIG)".
DEFAULT_CONFIG = (
+ ('api_version', API_VERSION),
('version', VERSION),
# Domain, realm, basedn:
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 216f9c08a..a6504d162 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -43,6 +43,7 @@ from text import _
from base import ReadOnly, NameSpace, lock, islocked, check_name
from constants import DEFAULT_CONFIG
from ipapython.ipa_log_manager import *
+from ipapython.version import VERSION, API_VERSION
# FIXME: Updated constants.TYPE_ERROR to use this clearer format from wehjit:
TYPE_ERROR = '%s: need a %r; got a %r: %r'
@@ -559,6 +560,8 @@ class API(DictProxy):
formatter=IPAHelpFormatter(),
usage='%prog [global-options] COMMAND [command-options]',
description='Manage an IPA domain',
+ version=('VERSION: %s, API_VERSION: %s'
+ % (VERSION, API_VERSION)),
epilog='\n'.join([
'See "ipa help topics" for available help topics.',
'See "ipa help <TOPIC>" for more information on a '