shikhar/ncclient — pull request #4 by nnakamot (2014-10-09 20:45:45+00:00)
Title: is_rpc_error_exempt always expects 'error-message' present

I'm seeing ncclient fails to handle rpc-error when 'error-message' is not included.
```
Traceback (most recent call last):
File "/users/nnakamot/bin/netconf_client_ncc2.py", line 112, in ssh_client(sys.argv[1])
File "/users/nnakamot/bin/netconf_client_ncc2.py", line 84, in ssh_client_request(to_ele(buf))
File "/users/nnakamot/lib/python/ncclient-0.4.1-py2.7.egg/ncclient/operations/rpc.py", line 305, in _request.self._reply.error.message):
File "/users/nnakamot/lib/python/ncclient-0.4.1-py2.7.egg/ncclient/devices/default.py", line 143, is_rpc_error_exempt
error_text = error_text.lower().strip()
AttributeError: 'NoneType' object has no attribute 'lower’
```
But I think it should be allowed as 'error-message' is an optional element.

I have this diff in devices/default.py to fix the issue:
```
*************** class DefaultDeviceHandler(object):
*** 140,145 ****
--- 140,148 ----
Return True/False depending on found match.
""”
+ if error_text is None:
+ return False
+
error_text = error_text.lower().strip()

# Compare the error text against all the exempt errors.
```

Thanks,
Norio@Cisco