summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2015-07-02 12:38:43 +0200
committerJan Cholasta <jcholast@redhat.com>2015-07-21 17:29:33 +0200
commita487e42d3fb71ceb3128fb9a2055a5586c4ed851 (patch)
treeb3d9d6f386604d0a22ed9ffef0ee8de84358a1a0
parent5ea41abe9836c94579115f9b220a8205b15d520d (diff)
downloadfreeipa-a487e42d3fb71ceb3128fb9a2055a5586c4ed851.zip
freeipa-a487e42d3fb71ceb3128fb9a2055a5586c4ed851.tar.gz
freeipa-a487e42d3fb71ceb3128fb9a2055a5586c4ed851.tar.xz
ipaplatform: Add constants submodule
Introduce a ipaplatform/constants.py file to store platform related constants, which are not paths. Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com>
-rw-r--r--Makefile3
-rw-r--r--freeipa.spec.in2
-rw-r--r--ipaplatform/base/constants.py11
-rw-r--r--ipaplatform/fedora/constants.py16
-rw-r--r--ipaplatform/redhat/constants.py17
-rw-r--r--ipaplatform/rhel/constants.py16
6 files changed, 64 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index abf5838..3c81466 100644
--- a/Makefile
+++ b/Makefile
@@ -159,10 +159,11 @@ version-update: release-update
if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
ipaplatform/__init__.py.in > ipaplatform/__init__.py; \
- rm -f ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py; \
+ rm -f ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ipaplatform/constants.py; \
ln -s $(SUPPORTED_PLATFORM)/paths.py ipaplatform/paths.py; \
ln -s $(SUPPORTED_PLATFORM)/services.py ipaplatform/services.py; \
ln -s $(SUPPORTED_PLATFORM)/tasks.py ipaplatform/tasks.py; \
+ ln -s $(SUPPORTED_PLATFORM)/constants.py ipaplatform/constants.py; \
fi
if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
diff --git a/freeipa.spec.in b/freeipa.spec.in
index fef20e1..928425f 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -381,6 +381,7 @@ rm -f ipapython/version.py
rm -f ipaplatform/services.py
rm -f ipaplatform/tasks.py
rm -f ipaplatform/paths.py
+rm -f ipaplatform/constants.py
make version-update
cd ipa-client; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd ..
%if ! %{ONLY_CLIENT}
@@ -403,6 +404,7 @@ rm -f ipapython/version.py
rm -f ipaplatform/services.py
rm -f ipaplatform/tasks.py
rm -f ipaplatform/paths.py
+rm -f ipaplatform/constants.py
make version-update
%if ! %{ONLY_CLIENT}
make install DESTDIR=%{buildroot}
diff --git a/ipaplatform/base/constants.py b/ipaplatform/base/constants.py
new file mode 100644
index 0000000..7048505
--- /dev/null
+++ b/ipaplatform/base/constants.py
@@ -0,0 +1,11 @@
+#
+# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
+#
+
+'''
+This base platform module exports platform dependant constants.
+'''
+
+
+class BaseConstantsNamespace(object):
+ pass
diff --git a/ipaplatform/fedora/constants.py b/ipaplatform/fedora/constants.py
new file mode 100644
index 0000000..ce03f58
--- /dev/null
+++ b/ipaplatform/fedora/constants.py
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
+#
+
+'''
+This Fedora base platform module exports platform related constants.
+'''
+
+# Fallback to default constant definitions
+from ipaplatform.redhat.constants import RedHatConstantsNamespace
+
+
+class FedoraConstantsNamespace(RedHatConstantsNamespace):
+ pass
+
+constants = FedoraConstantsNamespace()
diff --git a/ipaplatform/redhat/constants.py b/ipaplatform/redhat/constants.py
new file mode 100644
index 0000000..7209947
--- /dev/null
+++ b/ipaplatform/redhat/constants.py
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
+#
+
+'''
+This Red Hat OS family base platform module exports default platform
+related constants for the Red Hat OS family-based systems.
+'''
+
+# Fallback to default path definitions
+from ipaplatform.base.constants import BaseConstantsNamespace
+
+
+class RedHatConstantsNamespace(BaseConstantsNamespace):
+ pass
+
+constants = RedHatConstantsNamespace()
diff --git a/ipaplatform/rhel/constants.py b/ipaplatform/rhel/constants.py
new file mode 100644
index 0000000..eaca480
--- /dev/null
+++ b/ipaplatform/rhel/constants.py
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
+#
+
+'''
+This RHEL base platform module exports platform related constants.
+'''
+
+# Fallback to default constant definitions
+from ipaplatform.redhat.constants import RedHatConstantsNamespace
+
+
+class RHELConstantsNamespace(RedHatConstantsNamespace):
+ pass
+
+constants = RHELConstantsNamespace()