[Kimchi-devel] [project-kimchi][PATCHv2 2/2] Integrate nfs path check before create nfs pool
lvroyce at linux.vnet.ibm.com
lvroyce at linux.vnet.ibm.com
Wed Dec 18 09:34:45 UTC 2013
From: Royce Lv <lvroyce at linux.vnet.ibm.com>
Before creating nfs pool, add a prevalidation for the path
and see if it is able to complish a quick mount.
If not, deny this storage pool from being created.
Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
src/kimchi/model.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/model.py b/src/kimchi/model.py
index 73c18ac..705e768 100644
--- a/src/kimchi/model.py
+++ b/src/kimchi/model.py
@@ -69,7 +69,7 @@ from kimchi.networkxml import to_network_xml
from kimchi.objectstore import ObjectStore
from kimchi.scan import Scanner
from kimchi.screenshot import VMScreenshot
-from kimchi.utils import kimchi_log, is_digit, get_enabled_plugins
+from kimchi.utils import kimchi_log, is_digit, get_enabled_plugins, check_nfs_export
from kimchi.vmtemplate import VMTemplate
@@ -991,6 +991,11 @@ class Model(object):
if params['type'] == 'kimchi-iso':
task_id = self._do_deep_scan(params)
+ if params['type'] == 'netfs':
+ export_path = params['nfsserver'] + ':' + params['nfspath']
+ if not check_nfs_export(export_path):
+ raise InvalidParameter(
+ "Export path %s may block during nfs mount" % export_path)
xml = _get_pool_xml(**params)
except KeyError, key:
raise MissingParameter(key)
--
1.8.1.2
--
project-kimchi mailing list <project-kimchi at googlegroups.com>
https://groups.google.com/forum/#!forum/project-kimchi
---
You received this message because you are subscribed to the Google Groups "project-kimchi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-kimchi+unsubscribe at googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
More information about the Kimchi-devel
mailing list