Skip to content

Commit

Permalink
Move draft mode prop to ignore list
Browse files Browse the repository at this point in the history
Ignore draft_mode_state property.
Closes-Bug: 1771691

Change-Id: I3f499a9b073f62af0f87b9ad239bb669b12cd3d1
  • Loading branch information
psdsouza committed Jun 13, 2018
1 parent 62ca1ca commit 673bc57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 8 additions & 6 deletions config-client-mgr/config_cassandra_client.cc
Expand Up @@ -1018,6 +1018,10 @@ bool ConfigCassandraPartition::StoreKeyIfUpdated(const string &uuid,
//
if (ConfigClientManager::skip_properties.find(prop_name) !=
ConfigClientManager::skip_properties.end()) {
if ((prop_name.compare("draft_mode_state") == 0) &&
!adapter->value.empty()) {
context.ignore_object = true;
}
return false;
}
}
Expand All @@ -1042,13 +1046,13 @@ bool ConfigCassandraPartition::StoreKeyIfUpdated(const string &uuid,
context.list_map_properties.insert(make_pair(prop_name, *adapter));
}

if (adapter->key == "type") {
if (adapter->key.compare("type") == 0) {
if (context.obj_type.empty()) {
context.obj_type = adapter->value;
context.obj_type.erase(remove(context.obj_type.begin(),
context.obj_type.end(), '\"'), context.obj_type.end());
}
} else if (adapter->key == "fq_name") {
} else if (adapter->key.compare("fq_name") == 0) {
context.fq_name_present = true;
if (context.fq_name.empty()) {
context.fq_name = adapter->value.substr(1, adapter->value.size()-2);
Expand All @@ -1058,9 +1062,6 @@ bool ConfigCassandraPartition::StoreKeyIfUpdated(const string &uuid,
context.fq_name.end(), ' '), context.fq_name.end());
replace(context.fq_name.begin(), context.fq_name.end(), ',', ':');
}
} else if (adapter->key == "prop:draft_mode_state" &&
!adapter->value.empty()) {
context.ignore_object = true;
}
FieldDetailMap::iterator field_iter =
uuid_iter->second->GetFieldDetailMap().find(*adapter);
Expand All @@ -1074,7 +1075,8 @@ bool ConfigCassandraPartition::StoreKeyIfUpdated(const string &uuid,
} else {
field_iter->second.refreshed = true;
if (client()->SkipTimeStampCheckForTypeAndFQName() &&
(adapter->key == "type" || adapter->key == "fq_name")) {
((adapter->key.compare("type") == 0) ||
(adapter->key.compare("fq_name") == 0))) {
return true;
}
if (timestamp && field_iter->second.time_stamp == timestamp) {
Expand Down
3 changes: 2 additions & 1 deletion config-client-mgr/config_client_manager.cc
Expand Up @@ -25,7 +25,8 @@
using namespace boost::assign;
using namespace std;

const set<string> ConfigClientManager::skip_properties = list_of("perms2");
const set<string> ConfigClientManager::skip_properties =
list_of("perms2")("draft_mode_state");
bool ConfigClientManager::end_of_rib_computed_;

int ConfigClientManager::GetNumConfigReader() {
Expand Down

0 comments on commit 673bc57

Please sign in to comment.