summaryrefslogtreecommitdiffstats
path: root/commands/storage/lmi
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2014-01-17 10:43:33 +0100
committerJan Safranek <jsafrane@redhat.com>2014-01-17 10:43:33 +0100
commit121237eb5abe507cdd934dc55ed772e2586adad8 (patch)
tree95a86beb2762aa565b44f99a1a704d40d2a841dd /commands/storage/lmi
parent02cdc2cac3d8bc9c471e451cc6657a11026fbb82 (diff)
downloadopenlmi-scripts-121237eb5abe507cdd934dc55ed772e2586adad8.tar.gz
openlmi-scripts-121237eb5abe507cdd934dc55ed772e2586adad8.tar.xz
openlmi-scripts-121237eb5abe507cdd934dc55ed772e2586adad8.zip
Fixed get_largest_partition_size() showing WARNING message.
Do not show warning for NotEnoughFreeSpace return code, it's not any error condition, the disk is just full. Resolves: ticket #218
Diffstat (limited to 'commands/storage/lmi')
-rw-r--r--commands/storage/lmi/scripts/storage/partition.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/storage/lmi/scripts/storage/partition.py b/commands/storage/lmi/scripts/storage/partition.py
index 2cd08f6..ee9a0ad 100644
--- a/commands/storage/lmi/scripts/storage/partition.py
+++ b/commands/storage/lmi/scripts/storage/partition.py
@@ -279,6 +279,11 @@ def get_largest_partition_size(ns, device):
if not cap:
raise LmiFailed("Cannot find partition table on %s" % device.name)
(ret, outparams, err) = cap.FindPartitionLocation(Extent=device)
+
+ if ret == cap.FindPartitionLocation.FindPartitionLocationValues\
+ .NotEnoughFreeSpace:
+ return 0
+
if ret != 0:
if err:
LOG().warning("Cannot find largest partition size: %s." % err)