Ejemplo n.º 1
0
     #  END SNIPPET: get_vty_max_response
     """Resetting the max response length"""
     MAX_RESPONSE_LENGTH = 0
     vtyService.max_response = MAX_RESPONSE_LENGTH
     cli_result = vtyService.write(TEST_CMD2)
     logger.info("Test Command : %s", TEST_CMD2)
     logger.info("Test Command Max Response: %s", MAX_RESPONSE_LENGTH)
     logger.info("CLI Result for Test Command : %s", cli_result)
     try:
         """Show the parser state attributes"""
         tutorial.show_parser_state_attributes(parser_state)
     except OnepRemoteProcedureException as re:
         logger.error("Error in getting parser state", str(re))
     """Cancel the command execution"""
     #  START SNIPPET: vty_cancel_cmd
     vtyService.cancel()
     #  END SNIPPET: vty_cancel_cmd
     """Close the VTY connection on NE"""
     #  START SNIPPET: vty_close
     vtyService.close()
     #  END SNIPPET: vty_close
     """Check if the VTY is still open"""
     logger.info("Is Open - %s", vtyService.is_open())
     """Destroy the VTY"""
     #  START SNIPPET: vty_destroy
     vtyService.destroy()
     #  END SNIPPET: vty_destroy
 except Exception, e:
     #  START SNIPPET: disconnect_ne
     tutorial.disconnect()
     #  END SNIPPET: disconnect_ne