From 9f049ca14403f3696d54d186e6b1b15181f055df Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Fri, 10 Apr 2015 15:42:58 +0200 Subject: Server Upgrade: Verify version and platform Verify version and platform before upgrade or ipactl start|restart Upgrade: * do not allow upgrade on different platforms * do not allow upgrade data with higher version than build has Start: * do not start services if platform mismatch * do not start services if upgrade is needed * do not start services if data with higher version than build has New ipactl options: --skip-version-check: do not validate IPA version --ignore-service-failures (was --force): ignore if a service start fail and continue with starting other services --force: combine --skip-version-check and --ignore-service-failures https://fedorahosted.org/freeipa/ticket/4904 Reviewed-By: Jan Cholasta Reviewed-By: David Kupka --- ipaplatform/__init__.py | 22 ---------------------- ipaplatform/__init__.py.in | 12 ++++++++++++ ipaplatform/base/tasks.py | 10 ++++++++++ 3 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 ipaplatform/__init__.py create mode 100644 ipaplatform/__init__.py.in (limited to 'ipaplatform') diff --git a/ipaplatform/__init__.py b/ipaplatform/__init__.py deleted file mode 100644 index cf342aa3f..000000000 --- a/ipaplatform/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Authors: -# Tomas Babej -# -# Copyright (C) 2014 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, either version 3 of the License, or -# (at your option) any later version. -# -# 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, see . - -''' -Module containing platform-specific functionality for every platform. -''' diff --git a/ipaplatform/__init__.py.in b/ipaplatform/__init__.py.in new file mode 100644 index 000000000..61f6f3c4a --- /dev/null +++ b/ipaplatform/__init__.py.in @@ -0,0 +1,12 @@ +# +# Copyright (C) 2015 FreeIPA Contributors see COPYING for license +# + +''' +Module containing platform-specific functionality for every platform. +''' + +NAME = "__PLATFORM__" + +# FIXME: too much cyclic dependencies +# from __PLATFORM__ import paths, tasks, services diff --git a/ipaplatform/base/tasks.py b/ipaplatform/base/tasks.py index ff71c2bd1..10c5e835d 100644 --- a/ipaplatform/base/tasks.py +++ b/ipaplatform/base/tasks.py @@ -24,6 +24,9 @@ This module contains default platform-specific implementations of system tasks. import pwd import grp + +from pkg_resources import parse_version + from ipaplatform.paths import paths from ipapython.ipa_log_manager import log_mgr from ipapython import ipautil @@ -208,5 +211,12 @@ class BaseTaskNamespace(object): else: log.debug('user %s exists', name) + def parse_ipa_version(self, version): + """ + :param version: textual version + :return: object implementing proper __cmp__ method for version compare + """ + return parse_version(version) + task_namespace = BaseTaskNamespace() -- cgit