Skip to content

Commit 8aa7466

Browse files
APIGW-10470 Delphix startup screen should be updated for DCT appliances (#501)
1 parent 7984e08 commit 8aa7466

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

files/common/usr/bin/delphix-startup-screen

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22
#
3-
# Copyright 2020 Delphix
3+
# Copyright 2020, 2024 Delphix
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -126,12 +126,21 @@ def load_header(stdscr) -> Any:
126126
Display the header information for the main screen.
127127
"""
128128
WIN_LEN, WIN_HT = set_common_variables(stdscr)
129-
cmd = ['get-appliance-version', '--patch']
130-
cp = subprocess.run(cmd,
129+
130+
cp = subprocess.run('get-packaged-app-version',
131131
stdout=subprocess.PIPE,
132132
universal_newlines=True,
133133
check=True)
134134
version: str = cp.stdout
135+
if not version:
136+
# Use the packaged app version when available
137+
# fallback to the appliance version
138+
cmd = ['get-appliance-version', '--patch']
139+
cp = subprocess.run(cmd,
140+
stdout=subprocess.PIPE,
141+
universal_newlines=True,
142+
check=True)
143+
version = cp.stdout
135144

136145
stdscr.clear()
137146
stdscr.addstr(1, 2, LOGO + str(version), curses.A_BOLD)
@@ -219,15 +228,16 @@ def get_network_status() -> Tuple[str, str]:
219228

220229
ipaddrs = []
221230
for interface in interfaces():
222-
if interface == "lo":
231+
if (interface == "lo" or interface == "docker0" or
232+
interface.startswith("br-")):
223233
continue
224-
for link in ifaddresses(interface)[AF_INET]:
234+
for link in ifaddresses(interface).get(AF_INET, []):
225235
ipaddrs.append(link['addr'])
226236
hostname = os.uname()[1]
227237
return (hostname, ", ".join(ipaddrs))
228238

229239

230-
# pylint: disable-msg=too-many-locals
240+
# pylint: disable-msg=too-many-locals, too-many-statements
231241
def display_status(stdscr, win):
232242
"""
233243
Main display and input function. This function will display
@@ -292,8 +302,12 @@ def display_status(stdscr, win):
292302
statuswin.hline(START, 5, curses.ACS_HLINE, 45)
293303
for i in strout.split("\n"):
294304
START += 1
295-
statuswin.addstr(START, 2, " " * (width - 3), curses.A_BOLD)
296-
statuswin.addstr(START, 5, str(i), curses.A_STANDOUT)
305+
try:
306+
statuswin.addstr(START, 2, " " * (width - 3), curses.A_BOLD)
307+
statuswin.addstr(START, 5, str(i), curses.A_STANDOUT)
308+
except curses.error as e:
309+
# Probably exceeded available space
310+
logging.info(e)
297311
statuswin.noutrefresh()
298312

299313
curses.doupdate()

0 commit comments

Comments
 (0)