def _get_ip(self, interface):
if interface in ni.interfaces():<EOL><INDENT>addresses = ni.ifaddresses(interface)<EOL>if ni.AF_INET in addresses:<EOL><INDENT>return addresses[ni.AF_INET][<NUM_LIT:0>]["<STR_LIT>"]<EOL><DEDENT><DEDENT>return "<STR_LIT>"<EOL>
Returns the interface's IPv4 address if device exists and has a valid
ip address. Otherwise, returns an empty string