Skip to content

Commit

Permalink
Bugfix in trigger.twister2 causing default credentials to not be used. (
Browse files Browse the repository at this point in the history
#300)

- Bugfix in NetDevice.connected never returning the correct connection
  status when using the twister2 .open() and .close() methods.
- Bumped requirements to allow any version of Twisted 16.x
  • Loading branch information
jathanism committed Sep 21, 2016
1 parent c427671 commit e3030c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -15,7 +15,7 @@
requires = [
'IPy>=0.73',
'cryptography==1.4',
'Twisted>=15.4.0,<16.3.0',
'Twisted>=15.4.0,<17.0.0',
'crochet==1.5.0',
'mock==2.0.0',
'pyasn1', # Twisted conch needs this, but doesn't say so
Expand Down
2 changes: 1 addition & 1 deletion trigger/__init__.py
@@ -1,4 +1,4 @@
__version__ = (1, 6, 'rc2')
__version__ = (1, 6, 'rc3')

full_version = '.'.join(str(x) for x in __version__[0:3]) + \
''.join(__version__[3:])
Expand Down
6 changes: 1 addition & 5 deletions trigger/netdevices/__init__.py
Expand Up @@ -447,10 +447,6 @@ def _populate_acls(self, aclsdb=None):
self.implicit_acls = acls_dict['implicit']
self.acls = acls_dict['all']

def _is_connected(self):
"""TODO: Validate really connected to endpoint"""
self._connected = True

def __str__(self):
return self.nodeName

Expand Down Expand Up @@ -517,7 +513,7 @@ def inject_net_device_into_protocol(proto):
inject_net_device_into_protocol
)

self._connected = self._is_connected()
self._connected = True
return self._connected

def close(self):
Expand Down
3 changes: 1 addition & 2 deletions trigger/twister2.py
Expand Up @@ -36,13 +36,12 @@
from trigger.conf import settings
from trigger import tacacsrc, exceptions
from trigger.twister import is_awaiting_confirmation, has_ioslike_error, TriggerSSHUserAuth
from trigger import tacacsrc
from twisted.internet import reactor


@run_in_reactor
def generate_endpoint(device):
creds = tacacsrc.get_device_password(device.nodeName)
creds = tacacsrc.validate_credentials()
return TriggerSSHShellClientEndpointBase.newConnection(
reactor, creds.username, device, password=creds.password
)
Expand Down

0 comments on commit e3030c0

Please sign in to comment.