28 lines
413 B
Python
28 lines
413 B
Python
#
|
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
|
|
import socket
|
|
import getpass
|
|
|
|
|
|
def get_host_name():
|
|
return socket.gethostname()
|
|
|
|
|
|
def get_host_ip():
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
s.connect(("8.8.8.8", 80))
|
|
return s.getsockname()[0]
|
|
|
|
|
|
def get_user():
|
|
return getpass.getuser()
|
|
|
|
|
|
def get_password():
|
|
return getpass.getpass()
|