FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-02-2011, 02:52 PM
Ales Kozumplik
 
Default Use getDiskPart() from bootyutil.

So some code duplication and bugs are avoided.

Related: rhbz#572862
---
fsset.py | 34 +++-------------------------------
1 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/fsset.py b/fsset.py
index 54753a0..c958cdd 100644
--- a/fsset.py
+++ b/fsset.py
@@ -32,6 +32,7 @@ import lvm
import types
from flags import flags

+import bootyutil
import rhpl
from rhpl.translate import _, N_

@@ -3186,37 +3187,8 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint):

return 1

-# copy and paste job from booty/bootloaderInfo.py...
-def getDiskPart(dev):
- cut = len(dev)
- if (dev.startswith('rd/') or dev.startswith('ida/') or
- dev.startswith('cciss/') or dev.startswith('sx8/') or
- dev.startswith('mapper/')):
- if dev[-2] == 'p':
- cut = -1
- elif dev[-3] == 'p':
- cut = -2
- else:
- if dev[-2] in string.digits:
- cut = -2
- elif dev[-1] in string.digits:
- cut = -1
-
- name = dev[:cut]
-
- # hack off the trailing 'p' from /dev/cciss/*, for example
- if name[-1] == 'p':
- for letter in name:
- if letter not in string.letters and letter != "/":
- name = name[:-1]
- break
-
- if cut < 0:
- partNum = int(dev[cut:]) - 1
- else:
- partNum = None
-
- return (name, partNum)
+# The code for getDiskPart() is already present in booty, delegate the call there.
+getDiskPart = bootyutil.getDiskPart

def getExtFSFlagsFeatures(device):

--
1.7.3.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-02-2011, 03:07 PM
Martin Gracik
 
Default Use getDiskPart() from bootyutil.

ack

On Wed, 2011-03-02 at 16:52 +0100, Ales Kozumplik wrote:
> So some code duplication and bugs are avoided.
>
> Related: rhbz#572862
> ---
> fsset.py | 34 +++-------------------------------
> 1 files changed, 3 insertions(+), 31 deletions(-)
>
> diff --git a/fsset.py b/fsset.py
> index 54753a0..c958cdd 100644
> --- a/fsset.py
> +++ b/fsset.py
> @@ -32,6 +32,7 @@ import lvm
> import types
> from flags import flags
>
> +import bootyutil
> import rhpl
> from rhpl.translate import _, N_
>
> @@ -3186,37 +3187,8 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint):
>
> return 1
>
> -# copy and paste job from booty/bootloaderInfo.py...
> -def getDiskPart(dev):
> - cut = len(dev)
> - if (dev.startswith('rd/') or dev.startswith('ida/') or
> - dev.startswith('cciss/') or dev.startswith('sx8/') or
> - dev.startswith('mapper/')):
> - if dev[-2] == 'p':
> - cut = -1
> - elif dev[-3] == 'p':
> - cut = -2
> - else:
> - if dev[-2] in string.digits:
> - cut = -2
> - elif dev[-1] in string.digits:
> - cut = -1
> -
> - name = dev[:cut]
> -
> - # hack off the trailing 'p' from /dev/cciss/*, for example
> - if name[-1] == 'p':
> - for letter in name:
> - if letter not in string.letters and letter != "/":
> - name = name[:-1]
> - break
> -
> - if cut < 0:
> - partNum = int(dev[cut:]) - 1
> - else:
> - partNum = None
> -
> - return (name, partNum)
> +# The code for getDiskPart() is already present in booty, delegate the call there.
> +getDiskPart = bootyutil.getDiskPart
>
> def getExtFSFlagsFeatures(device):
>

--
Martin Gracik <mgracik@redhat.com>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org