Ensure ports are set correctly in accelerate module

This commit is contained in:
James Cammarata 2013-09-05 09:52:10 -05:00
parent eae0cb5d81
commit f6e1bdabea

View file

@ -49,6 +49,16 @@ class Connection(object):
self.accport = port[1]
self.is_connected = False
if not self.port:
self.port = constants.DEFAULT_REMOTE_PORT
elif not isinstance(self.port, int):
self.port = int(self.port)
if not self.accport:
self.accport = constants.ACCELERATE_PORT
elif not isinstance(self.accport, int):
self.accport = int(self.accport)
self.ssh = SSHConnection(
runner=self.runner,
host=self.host,
@ -58,9 +68,6 @@ class Connection(object):
private_key_file=private_key_file
)
if not self.accport:
self.accport = constants.ACCELERATE_PORT
# attempt to work around shared-memory funness
if getattr(self.runner, 'aes_keys', None):
utils.AES_KEYS = self.runner.aes_keys