Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic issue in last change #507

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions agent-ovs/lib/EndpointManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,14 +1054,14 @@ populateL2E(shared_ptr<modelgbp::epr::L2Universe>& l2u,
if (attr_map.find(name.get()) == attr_map.end())
epa->remove();
}
}
for (const pair<const string, string>& ap : attr_map) {
shared_ptr<ReportedEpAttribute> epa =
epas->addGbpeReportedEpAttribute(ap.first);
epa->setName(ap.first);
epa->setValue(ap.second);
if (VM_NAME_ATTR == ap.first)
l2e->setVmName(ap.second);
for (const pair<const string, string>& ap : attr_map) {
shared_ptr<ReportedEpAttribute> epa =
epas->addGbpeReportedEpAttribute(ap.first);
epa->setName(ap.first);
epa->setValue(ap.second);
if (VM_NAME_ATTR == ap.first)
l2e->setVmName(ap.second);
}
}

return l2e;
Expand Down
3 changes: 1 addition & 2 deletions agent-ovs/ovs/OvsdbConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,9 @@ void OvsdbConnection::handleMonitor(uint64_t reqId, const Document& payload) {
OvsdbRowDetails rowDetails;
std::string uuid = itr->name.GetString();
rowDetails["uuid"] = OvsdbValue(uuid);
std::string bridgeName;
processRowUpdate(itr->value, rowDetails);
if (rowDetails.find("name") != rowDetails.end()) {
bridgeName = rowDetails["name"].getStringValue();
auto& bridgeName = rowDetails["name"].getStringValue();
// use bridge name as key as that's the most common lookup
tableState[bridgeName] = rowDetails;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void genPublic(int aInIndent, MClass aInClass)
private void genClassId(int aInIndent, MClass aInClass)
{
String lClassName = getClassName(aInClass, false);
out.printHeaderComment(aInIndent, Arrays.asList("The unique class ID for " + lClassName));
out.printHeaderComment(aInIndent, Collections.singletonList("The unique class ID for " + lClassName));
out.println(aInIndent, "static const opflex::modb::class_id_t CLASS_ID = " + aInClass.getGID().getId() + ";");
out.println();
}
Expand Down Expand Up @@ -534,7 +534,7 @@ private void genPropMutator(
String lName = aInProp.getLID().getName();
String lPType = Strings.upFirstLetter(aInBaseType.getLID().getName());
lPType = getTypeAccessor(lPType);
List<String> lComments = Arrays.asList(
List<String> lComments = Collections.singletonList(
"Set " + lName + " to the specified value in the currently-active mutator.");
genPropMutator(aInIndent, aInClass, aInPropIdx,
lComments, aInComments, lName, lPType,
Expand Down Expand Up @@ -687,9 +687,12 @@ private void genSelfResolvers(int aInIdent, MClass aInClass)

Collection<List<Pair<String, MNameRule>>> lNamingPaths = new LinkedList<>();
boolean lIsUniqueNaming = aInClass.getNamingPaths(lNamingPaths, Language.CPP);
for (List<Pair<String, MNameRule>> lNamingPath : lNamingPaths)
if (lIsUniqueNaming)
{
genNamedSelfResolvers(aInIdent, aInClass, lNamingPath, lIsUniqueNaming);
for (List<Pair<String, MNameRule>> lNamingPath : lNamingPaths)
{
genNamedSelfResolvers(aInIdent, aInClass, lNamingPath);
}
}
}

Expand Down Expand Up @@ -857,10 +860,9 @@ private static String getMethName(List<Pair<String, MNameRule>> aInNamingPath,
}
}

private static String getResolverMethName(List<Pair<String, MNameRule>> aInNamingPath,
boolean aInIsUniqueNaming)
private static String getResolverMethName(List<Pair<String, MNameRule>> aInNamingPath)
{
return getMethName(aInNamingPath, aInIsUniqueNaming, "resolve");
return getMethName(aInNamingPath, true, "resolve");
}

private static String getRemoverMethName(List<Pair<String, MNameRule>> aInNamingPath,
Expand Down Expand Up @@ -1016,10 +1018,10 @@ public static void getUriBuilder(MClass aInChildClass, MNameRule aInNamingRule,
aOut.append(".build()");
}

private void genNamedSelfResolvers(int aInIdent, MClass aInClass, List<Pair<String, MNameRule>> aInNamingPath, boolean aInIsUniqueNaming)
private void genNamedSelfResolvers(int aInIdent, MClass aInClass, List<Pair<String, MNameRule>> aInNamingPath)
{
String lClassName = getClassName(aInClass, false);
String lMethodName = getResolverMethName(aInNamingPath, aInIsUniqueNaming);
String lMethodName = getResolverMethName(aInNamingPath);

ArrayList<String> comment = new ArrayList<>(Arrays.asList(
"Retrieve an instance of " + lClassName + " from the managed",
Expand Down
2 changes: 1 addition & 1 deletion libopflex/engine/MOSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ void MOSerializer::displayObject(std::ostream& ostream,
for (clsit = children.begin(); clsit != children.end(); ) {
const modb::ClassInfo& cci = store->getClassInfo(clsit->first);
if (clsit->second.empty() ||
(excludeObservables && cci.getType() != modb::ClassInfo::class_type_t::OBSERVABLE))
(excludeObservables && cci.getType() == modb::ClassInfo::class_type_t::OBSERVABLE))
children.erase(clsit++);
else {
hasChildren = true;
Expand Down
Loading