diff --git a/maxctrl/test/createdestroy.js b/maxctrl/test/createdestroy.js index 3214aadbf..bde20b181 100644 --- a/maxctrl/test/createdestroy.js +++ b/maxctrl/test/createdestroy.js @@ -137,7 +137,7 @@ describe("Create/Destroy Commands", function() { it('will not destroy static listener', function() { return doCommand('destroy listener RW-Split-Router RW-Split-Listener') - .should.be.rejected + .should.be.fulfilled }) it('create user', function() { diff --git a/server/core/config_runtime.cc b/server/core/config_runtime.cc index f10ef12a3..da3b2442d 100644 --- a/server/core/config_runtime.cc +++ b/server/core/config_runtime.cc @@ -1032,7 +1032,6 @@ bool runtime_create_listener(Service* service, bool runtime_destroy_listener(Service* service, const char* name) { - bool rval = false; char filename[PATH_MAX]; snprintf(filename, sizeof(filename), "%s/%s.cnf", get_config_persistdir(), name); @@ -1043,20 +1042,20 @@ bool runtime_destroy_listener(Service* service, const char* name) if (errno != ENOENT) { MXS_ERROR("Failed to remove persisted listener configuration '%s': %d, %s", - filename, - errno, - mxs_strerror(errno)); + filename, errno, mxs_strerror(errno)); + return false; } else { - config_runtime_error("Persisted configuration file for listener '%s' was not " - "found. This means that the listener was not created at " - "runtime. Remove the listener manually from the correct " - "configuration file.", - name); + MXS_WARNING("Persisted configuration file for listener '%s' was not found. This means that the " + "listener was not created at runtime. Remove the listener manually from the correct " + "configuration file to permanently destroy the listener.", name); } } - else if (!service_remove_listener(service, name)) + + bool rval = false; + + if (!service_remove_listener(service, name)) { MXS_ERROR("Failed to destroy listener '%s' for service '%s'", name, service->name); config_runtime_error("Failed to destroy listener '%s' for service '%s'", name, service->name); diff --git a/server/core/test/rest-api/test/service.js b/server/core/test/rest-api/test/service.js index a33ac8fec..79616f2d3 100644 --- a/server/core/test/rest-api/test/service.js +++ b/server/core/test/rest-api/test/service.js @@ -165,7 +165,7 @@ describe("Service", function() { it("destroy a static listener", function() { return request.delete(base_url + "/services/RW-Split-Router/listeners/RW-Split-Listener") - .should.be.rejected + .should.be.fulfilled }); after(stopMaxScale)