From 75ca71bf2cdabfba935feefe93b5aa55b1b4eb81 Mon Sep 17 00:00:00 2001 From: Tomasz Lesniewski Date: Tue, 24 Sep 2013 15:06:18 +0200 Subject: [PATCH 1/2] Module lvol fails when decimal point is a colon --- system/lvol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/lvol b/system/lvol index 4fdf764704a..14ebcaf1eb9 100644 --- a/system/lvol +++ b/system/lvol @@ -71,13 +71,16 @@ EXAMPLES = ''' - lvol: vg=firefly lv=test state=absent ''' +import re +decimal_point = pattern = re.compile(r"(\.|,)") + def parse_lvs(data): lvs = [] for line in data.splitlines(): parts = line.strip().split(';') lvs.append({ 'name': parts[0], - 'size': int(parts[1].split('.')[0]), + 'size': int(decimal_point.split(parts[1])[0]), }) return lvs From 0eb92ac852db6b6d930f67c7e0ff57824aca9f02 Mon Sep 17 00:00:00 2001 From: Tomasz Lesniewski Date: Tue, 24 Sep 2013 16:19:07 +0200 Subject: [PATCH 2/2] Module lvol fails when decimal point is a colon --- system/lvol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/lvol b/system/lvol index 14ebcaf1eb9..b827c6fca7e 100644 --- a/system/lvol +++ b/system/lvol @@ -72,7 +72,7 @@ EXAMPLES = ''' ''' import re -decimal_point = pattern = re.compile(r"(\.|,)") +decimal_point = re.compile(r"(\.|,)") def parse_lvs(data): lvs = []