summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iw/autopart_type.py11
-rw-r--r--textw/partition_text.py11
2 files changed, 18 insertions, 4 deletions
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index fb5e5f29a..39d099658 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -295,10 +295,17 @@ class PartitionTypeWindow(InstallWindow):
err = None
try:
- idx = target.rfind(":")
+ count = len(target.split(":"))
+ idx = target.rfind("]:")
+ # Check for IPV6 [IPV6-ip]:port
if idx != -1:
+ ip = target[1:idx]
+ port = target[idx+2:]
+ # Check for IPV4 aaa.bbb.ccc.ddd:port
+ elif count == 2:
+ idx = target.rfind(":")
ip = target[:idx]
- port = target[idx:]
+ port = target[idx+1:]
else:
ip = target
port = "3260"
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 412a7d75e..0024505b7 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -260,10 +260,17 @@ class PartitionTypeWindow:
target = entries[0].strip()
try:
- idx = target.rfind(":")
+ count = len(target.split(":"))
+ idx = target.rfind("]:")
+ # Check for IPV6 [IPV6-ip]:port
if idx != -1:
+ ip = target[1:idx]
+ port = target[idx+2:]
+ # Check for IPV4 aaa.bbb.ccc.ddd:port
+ elif count == 2:
+ idx = target.rfind(":")
ip = target[:idx]
- port = target[idx:]
+ port = target[idx+1:]
else:
ip = target
port = "3260"