Skip to content

Commit

Permalink
stop using _LOCALHOST, simple check if ip is in (127.0.0.1, localhost)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranczy authored and Veaceslav Mindru committed Jun 27, 2017
1 parent 0a5b8cd commit ce3ca6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/leappto/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

MACROCONTAINER_STORAGE_DIR = '/var/lib/leapp/macrocontainers/'
SOURCE_APP_EXPORT_DIR = '/var/lib/leapp/source_export/'
_LOCALHOST = ('localhost', '127.0.0.1')
_LOCALHOST='localhost'
_MIN_PORT = 1
_MAX_PORT = 65535

Expand Down Expand Up @@ -248,7 +248,7 @@ def source_addr(self):
return self.__get_machine_addr(self.source)

def _ssh_base(self, addr, cfg):
if addr in _LOCALHOST:
if addr == _LOCALHOST:
return []
return ['ssh'] + cfg + ['-4', addr]

Expand Down Expand Up @@ -900,7 +900,7 @@ def _net_util(port_list):

port_list = PortList()

if ip_or_fqdn in _LOCALHOST and not force_nmap:
if ip_or_fqdn in ('localhost', '127.0.0.1') and not force_nmap:
return _net_util(port_list)

ip = socket.gethostbyname(ip_or_fqdn)
Expand Down

0 comments on commit ce3ca6c

Please sign in to comment.