diff options
author | Andy Grover <agrover@redhat.com> | 2013-12-17 14:41:27 -0800 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2013-12-17 14:41:27 -0800 |
commit | 26e0552aa9e047b4d09833dbd7bd585756ec2bb7 (patch) | |
tree | 10219618b2da8d28bf18d614e9215927e764b6a6 /rtslib/utils.py | |
parent | 67eb46d88d3d6ccdcde4e8f7d55c959d49878a5a (diff) | |
download | rtslib-fb-26e0552aa9e047b4d09833dbd7bd585756ec2bb7.tar.gz |
str.replace() is not the same as str.translate()
If we want to remove both : and -, then we can futz around with translate
or we can just call replace() twice.
Signed-off-by: Andy Grover <agrover@redhat.com>
Diffstat (limited to 'rtslib/utils.py')
-rw-r--r-- | rtslib/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rtslib/utils.py b/rtslib/utils.py index e1b417d..4b4bad3 100644 --- a/rtslib/utils.py +++ b/rtslib/utils.py @@ -302,7 +302,8 @@ def _cleanse_wwn(wwn_type, wwn): if wwn_type in ('naa', 'eui', 'ib'): if wwn.startswith("0x"): wwn = wwn[2:] - wwn = wwn.replace(":-", "") + wwn = wwn.replace("-", "") + wwn = wwn.replace(":", "") if not (wwn.startswith("naa.") or wwn.startswith("eui.") or \ wwn.startswith("ib.")): |