Browse Source

[2209] Rename ZONE_RELOADED

Since it is not used for reloading a zone only. It is now ZONE_SUCCESS.
Michal 'vorner' Vaner 12 years ago
parent
commit
414a83fefb

+ 1 - 1
src/bin/auth/command.cc

@@ -203,7 +203,7 @@ public:
         }
         }
 
 
         switch (list->reload(origin)) {
         switch (list->reload(origin)) {
-            case ConfigurableClientList::ZONE_RELOADED:
+            case ConfigurableClientList::ZONE_SUCCESS:
                 // Everything worked fine.
                 // Everything worked fine.
                 LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_LOAD_ZONE)
                 LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_LOAD_ZONE)
                     .arg(zone_class).arg(origin);
                     .arg(zone_class).arg(origin);

+ 1 - 1
src/lib/datasrc/client_list.cc

@@ -435,7 +435,7 @@ ConfigurableClientList::getCachedZoneWriter(const Name& name) {
         load_action = boost::bind(loadZoneDataFromFile, _1, rrclass_, name,
         load_action = boost::bind(loadZoneDataFromFile, _1, rrclass_, name,
                                   filename);
                                   filename);
     }
     }
-    return (ZoneWriterPair(ZONE_RELOADED,
+    return (ZoneWriterPair(ZONE_SUCCESS,
                            ZoneWriterPtr(
                            ZoneWriterPtr(
                                result.info->cache_->getZoneTableSegment().
                                result.info->cache_->getZoneTableSegment().
                                getZoneWriter(load_action, name, rrclass_))));
                                getZoneWriter(load_action, name, rrclass_))));

+ 3 - 2
src/lib/datasrc/client_list.h

@@ -273,7 +273,8 @@ public:
         CACHE_DISABLED,     ///< The cache is not enabled in this list.
         CACHE_DISABLED,     ///< The cache is not enabled in this list.
         ZONE_NOT_CACHED,    ///< Zone is served directly, not from cache.
         ZONE_NOT_CACHED,    ///< Zone is served directly, not from cache.
         ZONE_NOT_FOUND,     ///< Zone does not exist or not cached.
         ZONE_NOT_FOUND,     ///< Zone does not exist or not cached.
-        ZONE_RELOADED       ///< The zone was successfully reloaded.
+        ZONE_SUCCESS        ///< The zone was successfully reloaded or
+                            ///  the writer provided.
     };
     };
 
 
     /// \brief Reloads a cached zone.
     /// \brief Reloads a cached zone.
@@ -309,7 +310,7 @@ public:
     /// \param zone The origin of the zone to reload.
     /// \param zone The origin of the zone to reload.
     /// \return The result has two parts. The first one is a status describing
     /// \return The result has two parts. The first one is a status describing
     ///     if it worked or not (and in case it didn't, also why). If the
     ///     if it worked or not (and in case it didn't, also why). If the
-    ///     status is ZONE_RELOADED, the second part contains a shared pointer
+    ///     status is ZONE_SUCCESS, the second part contains a shared pointer
     ///     to the writer. If the status is anything else, the second part is
     ///     to the writer. If the status is anything else, the second part is
     ///     NULL.
     ///     NULL.
     /// \throw DataSourceError or anything else that the data source
     /// \throw DataSourceError or anything else that the data source

+ 4 - 4
src/lib/datasrc/tests/client_list_unittest.cc

@@ -870,7 +870,7 @@ ConfigurableClientList::ReloadResult
 ReloadTest<WriterUpdateType>::doReload(const Name& origin) {
 ReloadTest<WriterUpdateType>::doReload(const Name& origin) {
     ConfigurableClientList::ZoneWriterPair
     ConfigurableClientList::ZoneWriterPair
         result(list_->getCachedZoneWriter(origin));
         result(list_->getCachedZoneWriter(origin));
-    if (result.first == ConfigurableClientList::ZONE_RELOADED) {
+    if (result.first == ConfigurableClientList::ZONE_SUCCESS) {
         // Can't use ASSERT_NE here, it would wan't to return(), which
         // Can't use ASSERT_NE here, it would wan't to return(), which
         // it can't in non-void function.
         // it can't in non-void function.
         if (result.second) {
         if (result.second) {
@@ -878,7 +878,7 @@ ReloadTest<WriterUpdateType>::doReload(const Name& origin) {
             result.second->install();
             result.second->install();
             result.second->cleanup();
             result.second->cleanup();
         } else {
         } else {
-            ADD_FAILURE() << "getCachedZoneWriter returned ZONE_RELOADED, "
+            ADD_FAILURE() << "getCachedZoneWriter returned ZONE_SUCCESS, "
                 "but the writer is NULL";
                 "but the writer is NULL";
         }
         }
     } else {
     } else {
@@ -902,7 +902,7 @@ TYPED_TEST(ReloadTest, reloadSuccess) {
     EXPECT_EQ(ZoneFinder::NXRRSET,
     EXPECT_EQ(ZoneFinder::NXRRSET,
               this->list_->find(name).finder_->find(name, RRType::NS())->code);
               this->list_->find(name).finder_->find(name, RRType::NS())->code);
     // Now reload the full zone. It should be there now.
     // Now reload the full zone. It should be there now.
-    EXPECT_EQ(ConfigurableClientList::ZONE_RELOADED, this->doReload(name));
+    EXPECT_EQ(ConfigurableClientList::ZONE_SUCCESS, this->doReload(name));
     EXPECT_EQ(ZoneFinder::SUCCESS,
     EXPECT_EQ(ZoneFinder::SUCCESS,
               this->list_->find(name).finder_->find(name, RRType::NS())->code);
               this->list_->find(name).finder_->find(name, RRType::NS())->code);
 }
 }
@@ -1035,7 +1035,7 @@ TYPED_TEST(ReloadTest, reloadMasterFile) {
     f << "nosuchdomain.\t\t3600\tIN\tTXT\ttest" << std::endl;
     f << "nosuchdomain.\t\t3600\tIN\tTXT\ttest" << std::endl;
     f.close();
     f.close();
     // Do the reload.
     // Do the reload.
-    EXPECT_EQ(ConfigurableClientList::ZONE_RELOADED, this->doReload(Name(".")));
+    EXPECT_EQ(ConfigurableClientList::ZONE_SUCCESS, this->doReload(Name(".")));
     // It is here now.
     // It is here now.
     EXPECT_EQ(ZoneFinder::SUCCESS,
     EXPECT_EQ(ZoneFinder::SUCCESS,
               this->list_->find(Name(".")).finder_->find(Name("nosuchdomain"),
               this->list_->find(Name(".")).finder_->find(Name("nosuchdomain"),