From 0d308d86ae5a20cbad5aa720c7ed685325200b9d Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 25 Jun 2001 05:50:45 +0000 Subject: register a parted exception handler for gui mode modified isys.makeDevInode to use /dev/foo if it is there, while preserving backwards compatible behavior import fsset for workstation, it needs to find the ext2 filesystemtype for some reason skip drives that can't be opened or partition tables that can't be read. we still need to handle 'fresh' disks better. --- isys/isys.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'isys') diff --git a/isys/isys.py b/isys/isys.py index 219d8136f..eec388d56 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -196,8 +196,17 @@ def cdromList(): def moduleListByType(type): return _isys.modulelist(type) -def makeDevInode(name, fn): - return _isys.mkdevinode(name, fn) +def makeDevInode(name, fn=None): + if fn: + _isys.mkdevinode(name, fn) + return fn + path = '/dev/%s' % (name,) + try: + os.stat(path) + except OSError: + path = '/tmp/%s' % (name,) + _isys.mkdevinode(name, fn) + return path def inet_ntoa (addr): return "%d.%d.%d.%d" % ((addr >> 24) & 0x000000ff, -- cgit