Skip to content

Commit ed03882

Browse files
committed
fixes
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 7e56e5f commit ed03882

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/linstorvolumemanager.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ def _get_controller_addresses() -> List[str]:
139139
(ret, stdout, stderr) = util.doexec([
140140
"/usr/sbin/ss", "-tnpH", "state", "established", f"( sport = :{LINSTOR_SATELLITE_PORT} )"
141141
])
142-
return [
143-
line.split()[3].split(":")[0]
144-
for line in stdout.splitlines()
145-
]
142+
if ret == 0:
143+
return [
144+
line.split()[3].rsplit(":", 1)[0]
145+
for line in stdout.splitlines()
146+
]
147+
util.SMlog(f"Unexpected code {ret}: {stderr}")
146148
except Exception as e:
147149
util.SMlog(f"Unable to get controller addresses: {e}")
148-
return []
150+
return []
149151

150152
def _get_controller_uri() -> str:
151153
# TODO: Check that an IP address from the current pool is returned.
@@ -160,7 +162,7 @@ def get_controller_uri():
160162
return uri
161163

162164
retries += 1
163-
if retries >= 10:
165+
if retries >= 30:
164166
break
165167
time.sleep(1)
166168

0 commit comments

Comments
 (0)