Browse Source

[2379] Add InvalidOperation to the pydnspp exceptions

Jelte Jansen 12 years ago
parent
commit
98d529881b

+ 4 - 0
src/lib/dns/python/pydnspp.cc

@@ -777,6 +777,10 @@ PyInit_pydnspp(void) {
     po_IscException = PyErr_NewException("pydnspp.IscException", NULL, NULL);
     PyModule_AddObject(mod, "IscException", po_IscException);
 
+    po_InvalidOperation = PyErr_NewException("pydnspp.InvalidOperation",
+                                             NULL, NULL);
+    PyModule_AddObject(mod, "InvalidOperation", po_InvalidOperation);
+
     po_InvalidParameter = PyErr_NewException("pydnspp.InvalidParameter",
                                              NULL, NULL);
     PyModule_AddObject(mod, "InvalidParameter", po_InvalidParameter);

+ 1 - 0
src/lib/dns/python/pydnspp_common.cc

@@ -47,6 +47,7 @@ namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
 PyObject* po_IscException;
+PyObject* po_InvalidOperation;
 PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception

+ 1 - 0
src/lib/dns/python/pydnspp_common.h

@@ -28,6 +28,7 @@ namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
 extern PyObject* po_IscException;
+extern PyObject* po_InvalidOperation;
 extern PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception

+ 8 - 0
src/lib/python/isc/datasrc/tests/testdata/example.com.ch

@@ -0,0 +1,8 @@
+example.com.         1000  CH  SOA a.dns.example.com. mail.example.com. 1 1 1 1 1
+example.com.         1000  CH  NS  a.dns.example.com.
+example.com.         1000  CH  NS  b.dns.example.com.
+example.com.         1000  CH  NS  c.dns.example.com.
+a.dns.example.com.   1000  CH  A    1.1.1.1
+b.dns.example.com.   1000  CH  A    3.3.3.3
+b.dns.example.com.   1000  CH  AAAA 4:4::4:4
+b.dns.example.com.   1000  CH  AAAA 5:5::5:5

BIN
src/lib/python/isc/datasrc/tests/testdata/example.com.source.sqlite3