I am trying to get the "Device Name" or node name on my different systems, using this python 3.8.1 code:
import platform
uname = platform.uname()
print(f'Device name: {uname}')
This works as expected on Ubuntu 18.04, but on my 19.04 system I get 'ip-10-0-0-40' rather than the device name -- by device name, I mean the Device Name displayed in the system's details/about section -- the name that I assigned to the system when installing the OS.
I can solve my application's program other ways -- only do X if on system Y -- but now I am curious if this is a Python/Ubuntu 19.04 issue for everyone or it's just my system.
UPDATE: I had an SSH connection open to an EC2 instance at Amazon in one terminal session. When I terminated that connection, I get the expected result -- but even when I was running on a local terminal session. I will probably fallback to an environment variable to avoid this ambiguous result. But would still love to know how to always get the local device name reliably.