summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2015-03-26 14:55:27 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2015-03-27 19:46:52 +0100
commit101022e3bf4dfe3f0c56ffb61abbf358a3b1ab26 (patch)
treeb0a78aab69144734c0d38c69188beffd61603aa6
parent83ac397cd5904cbbaa5a21adcac73815dda9fa63 (diff)
downloadipsilon-101022e3bf4dfe3f0c56ffb61abbf358a3b1ab26.zip
ipsilon-101022e3bf4dfe3f0c56ffb61abbf358a3b1ab26.tar.gz
ipsilon-101022e3bf4dfe3f0c56ffb61abbf358a3b1ab26.tar.xz
Add a method to Installer classes to validate argument input
There was no way to validate argument input from plugins and cause the installer to bail out. If a plugin needs to validate some input it can use the validate_args() method and raise ConfigurationError() if an issue is found. https://fedorahosted.org/ipsilon/ticket/78 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
-rw-r--r--ipsilon/helpers/common.py3
-rw-r--r--ipsilon/info/common.py3
-rwxr-xr-xipsilon/install/ipsilon-server-install5
-rw-r--r--ipsilon/login/common.py3
-rw-r--r--ipsilon/providers/common.py3
5 files changed, 17 insertions, 0 deletions
diff --git a/ipsilon/helpers/common.py b/ipsilon/helpers/common.py
index dcbde2b..8eff274 100644
--- a/ipsilon/helpers/common.py
+++ b/ipsilon/helpers/common.py
@@ -33,6 +33,9 @@ class EnvHelpersInstaller(object):
def install_args(self, group):
raise NotImplementedError
+ def validate_args(self, args):
+ return
+
def configure_server(self, opts):
raise NotImplementedError
diff --git a/ipsilon/info/common.py b/ipsilon/info/common.py
index 725f0fa..dd48ae9 100644
--- a/ipsilon/info/common.py
+++ b/ipsilon/info/common.py
@@ -94,6 +94,9 @@ class InfoProviderInstaller(object):
def install_args(self, group):
raise NotImplementedError
+ def validate_args(self, args):
+ return
+
def unconfigure(self, opts):
return
diff --git a/ipsilon/install/ipsilon-server-install b/ipsilon/install/ipsilon-server-install
index edcccb6..8f915f3 100755
--- a/ipsilon/install/ipsilon-server-install
+++ b/ipsilon/install/ipsilon-server-install
@@ -348,6 +348,11 @@ def parse_args(plugins):
if len(args['hostname'].split('.')) < 2:
raise ConfigurationError('Hostname: %s is not a FQDN')
+ for plugin_group in plugins:
+ for plugin_name in plugins[plugin_group]:
+ plugin = plugins[plugin_group][plugin_name]
+ plugin.validate_args(args)
+
try:
pwd.getpwnam(args['system_user'])
except KeyError:
diff --git a/ipsilon/login/common.py b/ipsilon/login/common.py
index a3020a4..9beb741 100644
--- a/ipsilon/login/common.py
+++ b/ipsilon/login/common.py
@@ -310,6 +310,9 @@ class LoginManagerInstaller(object):
def install_args(self, group):
raise NotImplementedError
+ def validate_args(self, args):
+ return
+
def configure(self, opts):
raise NotImplementedError
diff --git a/ipsilon/providers/common.py b/ipsilon/providers/common.py
index 169fddc..74c00df 100644
--- a/ipsilon/providers/common.py
+++ b/ipsilon/providers/common.py
@@ -125,6 +125,9 @@ class ProviderInstaller(object):
def install_args(self, group):
raise NotImplementedError
+ def validate_args(self, args):
+ return
+
def configure(self, opts):
raise NotImplementedError