Skip to content

Commit 7826de0

Browse files
committed
Correctly handle case where FQDN not provided
1 parent c3413f8 commit 7826de0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/manage_iocs/commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,11 @@ def install(ioc: str):
217217

218218
service_file = utils.SYSTEMD_SERVICE_PATH / f"softioc-{ioc}.service"
219219
ioc_config = utils.find_iocs()[ioc]
220+
base_hostname = socket.gethostname()
221+
if "." in base_hostname:
222+
base_hostname = base_hostname.split(".")[0]
220223

221-
if socket.gethostname() != ioc_config.host and ioc_config.host != "localhost":
224+
if ioc_config.host not in [base_hostname, "localhost", socket.gethostname()]:
222225
raise RuntimeError(
223226
f"Cannot install IOC '{ioc}' on this host; configured host is '{ioc_config.host}'!"
224227
)

0 commit comments

Comments
 (0)