Signed-off-by: Tomer Haskalovitch <tomer.haska@ibm.com>
location = gw.get('location', '')
# Extract hostname from gw-id (format: client.nvmeof.pool.group.hostname.xxx)
+ # pool might contains '.'
if gw_id:
parts = gw_id.split('.')
if len(parts) >= 5:
- hostname = parts[4]
+ hostname = parts[-2]
if location:
host_to_location[hostname] = location
else:
nvmeof_pool_helper = NvmeofMetadataPoolHelper(self)
nvmeof_pool_helper.create_pool_if_needed()
- cleanpool = pool.lstrip('.')
spec = NvmeofServiceSpec(
- service_id=f'{cleanpool}.{group}' if group else cleanpool,
+ service_id=f'{pool}.{group}' if group else pool,
pool=pool,
group=group,
placement=PlacementSpec.from_string(placement),