[Groonga-commit] groonga/gcs [master] Return DeleteDomainResponse for DeleteDomain with unexisting domain

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 5 16:30:30 JST 2012


YUKI Hiroshi	2012-11-05 16:30:30 +0900 (Mon, 05 Nov 2012)

  New Revision: 233e9f709ab84a4502f2104751d21a164089e782
  https://github.com/groonga/gcs/commit/233e9f709ab84a4502f2104751d21a164089e782

  Log:
    Return DeleteDomainResponse for DeleteDomain with unexisting domain

  Modified files:
    lib/api/2011-02-01/configuration.js

  Modified: lib/api/2011-02-01/configuration.js (+11 -6)
===================================================================
--- lib/api/2011-02-01/configuration.js    2012-11-05 16:26:20 +0900 (0c9ab8d)
+++ lib/api/2011-02-01/configuration.js    2012-11-05 16:30:30 +0900 (30f7a14)
@@ -131,12 +131,17 @@ handlers.CreateDomain = function(context, request, response, config) {
 
 handlers.DeleteDomain = function(context, request, response, config) {
   var domain = new Domain(request.query.DomainName, context);
-  domain.deleteSync();
-  var result = createDomainStatus({
-        domain:      domain,
-        hostAndPort: getBaseHostAndPort(config, request),
-        deleted:     true
-      });
+  var result;
+  if (domain.exists()) {
+    domain.deleteSync();
+    result = createDomainStatus({
+      domain:      domain,
+      hostAndPort: getBaseHostAndPort(config, request),
+      deleted:     true
+    });
+  } else {
+    result = null;
+  }
   response.contentType('application/xml');
   response.send(createGenericResponse('DeleteDomain', result));
 };
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index