Revision 41e2ed46 ncclient/transport/ssh.py

b/ncclient/transport/ssh.py
20 20

  
21 21
import paramiko
22 22

  
23
from . import logger
24 23
from errors import AuthenticationError, SessionCloseError, SSHError, SSHUnknownHostError
25 24
from session import Session
26 25

  
26
import logging
27
logger = logging.getLogger('ncclient.transport.ssh')
28

  
27 29
BUF_SIZE = 4096
28 30
MSG_DELIM = ']]>]]>'
29 31
TICK = 0.1
......
42 44
        # parsing-related, see _parse()
43 45
        self._parsing_state = 0 
44 46
        self._parsing_pos = 0
45
        logger.debug('[SSHSession object created]')
46 47
    
47 48
    def _parse(self):
48 49
        '''Messages ae delimited by MSG_DELIM. The buffer could have grown by a
......
76 77
            else: # if we didn't break out of the loop, full delim was parsed
77 78
                msg_till = buf.tell() - n
78 79
                buf.seek(0)
79
                self._dispatch_received(buf.read(msg_till).strip())
80
                logger.debug('parsed new message')
81
                self._dispatch_message(buf.read(msg_till).strip())
80 82
                buf.seek(n+1, os.SEEK_CUR)
81 83
                rest = buf.read()
82 84
                buf = StringIO()
......
170 172
        self._connected = True # there was no error authenticating
171 173
        
172 174
        c = self._channel = self._transport.open_session()
173
        c.invoke_subsystem('netconf')
174 175
        c.set_name('netconf')
176
        c.invoke_subsystem('netconf')
175 177
        
176 178
        self._post_connect()
177 179
    
......
264 266
                    else:
265 267
                        raise SessionCloseError(self._buffer.getvalue())
266 268
                if not q.empty() and chan.send_ready():
269
                    logger.debug('sending message')
267 270
                    data = q.get() + MSG_DELIM
268 271
                    while data:
269 272
                        n = chan.send(data)
......
271 274
                            raise SessionCloseError(self._buffer.getvalue(), data)
272 275
                        data = data[n:]
273 276
        except Exception as e:
274
            logger.debug('*** broke out of main loop ***')
277
            logger.debug('broke out of main loop')
275 278
            self.close()
276 279
            if not (isinstance(e, SessionCloseError) and self._expecting_close):
277 280
                self._dispatch_error(e)

Also available in: Unified diff