summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2011-02-18 13:37:52 +0100
committerAles Kozumplik <akozumpl@redhat.com>2011-02-21 10:08:15 +0100
commitce69582065955c380db29cb735eaac9f429f08b5 (patch)
tree8bf0fb82b128920efb931f27a60e8476a9fed75b
parent58e76d37ed8e55e4ac8f5e02febbc242a6a3bc4e (diff)
downloadanaconda-ce69582065955c380db29cb735eaac9f429f08b5.tar.gz
anaconda-ce69582065955c380db29cb735eaac9f429f08b5.tar.xz
anaconda-ce69582065955c380db29cb735eaac9f429f08b5.zip
Remove storage/miscutils.py, it is not used.
Is probably something left over from storage rewrite. We are better off without it since some of its methods clash with iutil.py methods.
-rw-r--r--pyanaconda/storage/miscutils.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/pyanaconda/storage/miscutils.py b/pyanaconda/storage/miscutils.py
deleted file mode 100644
index e57749777..000000000
--- a/pyanaconda/storage/miscutils.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# iutil.py stubs
-import os
-
-import logging
-log = logging.getLogger("storage")
-
-def notify_kernel(path, action="change"):
- """ Signal the kernel that the specified device has changed. """
- log.debug("notifying kernel of '%s' event on device %s" % (action, path))
- path = os.path.join(path, "uevent")
- if not path.startswith("/sys/") or not os.access(path, os.W_OK):
- log.debug("sysfs path '%s' invalid" % path)
- raise ValueError("invalid sysfs path")
-
- f = open(path, "a")
- f.write("%s\n" % action)
- f.close()
-
-def get_sysfs_path_by_name(dev_name, class_name="block"):
- dev_name = os.path.basename(dev_name)
- sysfs_class_dir = "/sys/class/%s" % class_name
- dev_path = os.path.join(sysfs_class_dir, dev_name)
- if os.path.exists(dev_path):
- return dev_path
-
-import inspect
-def log_method_call(d, *args, **kwargs):
- classname = d.__class__.__name__
- methodname = inspect.stack()[1][3]
- fmt = "%s.%s:"
- fmt_args = [classname, methodname]
- for arg in args:
- fmt += " %s ;"
- fmt_args.append(arg)
-
- for k, v in kwargs.items():
- fmt += " %s: %s ;"
- fmt_args.extend([k, v])
-
- log.debug(fmt % tuple(fmt_args))
-
-def numeric_type(num):
- """ Verify that a value is given as a numeric data type.
-
- Return the number if the type is sensible or raise ValueError
- if not.
- """
- if num is None:
- num = 0
- elif not (isinstance(num, int) or \
- isinstance(num, long) or \
- isinstance(num, float)):
- raise ValueError("value (%s) must be either a number or None" % num)
-
- return num
-
-