Skip to content

Commit 4b860b0

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

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

drivers/linstor-manager

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ LVM_PLUGIN = 'lvm.py'
4747
THIN_POOL = 'thin_pool'
4848

4949
FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port'
50-
LINSTOR_PORTS = [LINSTOR_SATELLITE_PORT, 3370, 3376, 3377, 8076, 8077]
50+
LINSTOR_PORTS = (LINSTOR_SATELLITE_PORT, 3370, 3376, 3377, 8076, 8077)
5151
DRBD_PORTS = '7000:8000'
5252

5353
DRBD_REACTOR_CONF = '/etc/drbd-reactor.d/sm-linstor.toml'

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)