[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Fix handling of priority option from swap fstab entries. (#494992)



---
 storage/formats/swap.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/storage/formats/swap.py b/storage/formats/swap.py
index bc5dbd9..31774dc 100644
--- a/storage/formats/swap.py
+++ b/storage/formats/swap.py
@@ -92,8 +92,11 @@ class SwapSpace(DeviceFormat):
         for option in opts.split(","):
             (opt, equals, arg) = option.partition("=")
             if equals and opt == "pri":
-                self.priority = numeric_type(arg)
-                    
+                try:
+                    self.priority = int(arg)
+                except ValueError:
+                    log.info("invalid value for swap priority: %s" % arg)
+
     options = property(_getOptions, _setOptions,
                        doc="The swap device's fstab options string")
 
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]