string.join() by default adds a space between each char/word unless explicitly noted otherwise.
Resolves: rhbz#875652 --- booty/checkbootloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py index d58df8e..c76b5bf 100644 --- a/booty/checkbootloader.py +++ b/booty/checkbootloader.py @@ -106,7 +106,7 @@ def getBootDevList(line): for dev in devs: dev = getBootDevString("=%s" % (dev,)) rets.append(dev) - return string.join(rets) + return string.join(rets, "")
def getBootloaderTypeAndBoot(instRoot, storage): haveGrubConf = 1 -- 1.8.0
On Mon, 2012-12-03 at 11:46 -0500, Samantha N. Bueno wrote:
string.join() by default adds a space between each char/word unless explicitly noted otherwise.
Resolves: rhbz#875652
booty/checkbootloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py index d58df8e..c76b5bf 100644 --- a/booty/checkbootloader.py +++ b/booty/checkbootloader.py @@ -106,7 +106,7 @@ def getBootDevList(line): for dev in devs: dev = getBootDevString("=%s" % (dev,)) rets.append(dev)
- return string.join(rets)
- return string.join(rets, "")
Good point, but I'd rather see
"".join(rets)
here. Droping 'string' module import would be even better, but I guess that's a lot more work.
On Mon, Dec 03, 2012 at 09:53:05PM +0100, Vratislav Podzimek wrote:
On Mon, 2012-12-03 at 11:46 -0500, Samantha N. Bueno wrote:
string.join() by default adds a space between each char/word unless explicitly noted otherwise.
Resolves: rhbz#875652
booty/checkbootloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py index d58df8e..c76b5bf 100644 --- a/booty/checkbootloader.py +++ b/booty/checkbootloader.py @@ -106,7 +106,7 @@ def getBootDevList(line): for dev in devs: dev = getBootDevString("=%s" % (dev,)) rets.append(dev)
- return string.join(rets)
- return string.join(rets, "")
Good point, but I'd rather see
"".join(rets)
here. Droping 'string' module import would be even better, but I guess that's a lot more work.
Hmm, bcl spoke to me in #anaconda about this actually. It turns out the problem lay just a little further down than where my fix is. The "for dev in devs:" block is unnecessary since it is splitting a string that was already formatted correctly into an array of characters (rets), hence the spaces between each one upon string.join().
Patch has been amended; adding it shortly.
Samantha
Remove some old cruft that was splitting a string into chars, causing a space to be injected between each char upon calling join().
Resolves: rhbz#875652 --- booty/checkbootloader.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py index d58df8e..a9bd970 100644 --- a/booty/checkbootloader.py +++ b/booty/checkbootloader.py @@ -101,12 +101,8 @@ def getBootDevString(line): return dev
def getBootDevList(line): - devs = string.split(line, '=')[1] - rets = [] - for dev in devs: - dev = getBootDevString("=%s" % (dev,)) - rets.append(dev) - return string.join(rets) + dev = string.split(line, '=')[1] + return getBootDevString("=%s" % (dev,))
def getBootloaderTypeAndBoot(instRoot, storage): haveGrubConf = 1 -- 1.8.0
On Wed, Dec 05, 2012 at 09:25:38AM -0500, Samantha N. Bueno wrote:
Remove some old cruft that was splitting a string into chars, causing a space to be injected between each char upon calling join().
Resolves: rhbz#875652
booty/checkbootloader.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Ack
anaconda-patches@lists.fedorahosted.org