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 08-19-2010, 12:58 PM
Ales Kozumplik
 
Default *' when filtering 'sda'

Resolves: rhbz#624175
---
storage/devicelibs/lvm.py | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
index 42fe432..7400745 100644
--- a/storage/devicelibs/lvm.py
+++ b/storage/devicelibs/lvm.py
@@ -23,6 +23,7 @@
import os
import math
import re
+import string

import iutil

@@ -65,17 +66,23 @@ def _composeConfig():
config_args = []

filter_string = ""
- rejects = config_args_data["filterRejects"]
# we don't need the accept for now.
# accepts = config_args_data["filterAccepts"]
# if len(accepts) > 0:
# for i in range(len(rejects)):
# filter_string = filter_string + (""a|/%s$|", " % accepts[i])

- if len(rejects) > 0:
- for i in range(len(rejects)):
- filter_string = filter_string + (""r|/%s$|"," % rejects[i])
-
+ rejects = config_args_data["filterRejects"]
+ for reject in rejects:
+ # If reject is "sda" we want both "sda" and "sda10" rejected but not
+ # "sdab". If reject is "sda1" we want precisely "sda1" rejected and not
+ # "sda10"
+ if reject[-1] in string.digits:
+ # ends with a digit
+ filter_string += (""r|/%s$|"," % reject)
+ else:
+ # doesn't end with a digit so also match any number of digits
+ filter_string += (""r|/%s%s$|"," % (reject, r'[0-9]*'))

filter_string = " filter=[%s] " % filter_string.strip(",")

--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-19-2010, 01:33 PM
Ales Kozumplik
 
Default *' when filtering 'sda'

On 08/19/2010 02:58 PM, Ales Kozumplik wrote:

Resolves: rhbz#624175
---


The reporter has confirmed that a similar (though admittedly more
radical) patch fixed the problem for them.


Example of a filter rule generated with it:
09:43:30,536 INFO : Running... ['lvm', 'lvchange', '-a', 'y',
'--config', ' devices {
filter=["r|/vda[0-9]*$|","r|/vdd[0-9]*$|","r|/vda1$|","r|/vda2$|","r|/vdd1$|"]
} ', 'vg_dhcp55/lv_root']


(note that with multipath, vdd1 never makes it to the filter so there we
really need the vdd[0-9]*)


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-19-2010, 03:10 PM
David Lehman
 
Default *' when filtering 'sda'

On Thu, 2010-08-19 at 14:58 +0200, Ales Kozumplik wrote:
> Resolves: rhbz#624175
> ---
> storage/devicelibs/lvm.py | 17 ++++++++++++-----
> 1 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
> index 42fe432..7400745 100644
> --- a/storage/devicelibs/lvm.py
> +++ b/storage/devicelibs/lvm.py
> @@ -23,6 +23,7 @@
> import os
> import math
> import re
> +import string
>
> import iutil
>
> @@ -65,17 +66,23 @@ def _composeConfig():
> config_args = []
>
> filter_string = ""
> - rejects = config_args_data["filterRejects"]
> # we don't need the accept for now.
> # accepts = config_args_data["filterAccepts"]
> # if len(accepts) > 0:
> # for i in range(len(rejects)):
> # filter_string = filter_string + (""a|/%s$|", " % accepts[i])
>
> - if len(rejects) > 0:
> - for i in range(len(rejects)):
> - filter_string = filter_string + (""r|/%s$|"," % rejects[i])
> -
> + rejects = config_args_data["filterRejects"]
> + for reject in rejects:
> + # If reject is "sda" we want both "sda" and "sda10" rejected but not
> + # "sdab". If reject is "sda1" we want precisely "sda1" rejected and not
> + # "sda10"
> + if reject[-1] in string.digits:
> + # ends with a digit
> + filter_string += (""r|/%s$|"," % reject)
> + else:
> + # doesn't end with a digit so also match any number of digits
> + filter_string += (""r|/%s%s$|"," % (reject, r'[0-9]*'))

You'll want to also add r'p[0-9]*' for devices like mpatha, whose
partitions get device names like mpathap2.

Dave

>
> filter_string = " filter=[%s] " % filter_string.strip(",")
>


_______________________________________________
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 12:05 PM.

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