topology: move powered_by quirk to config parsing

The legacy topology schemas only declare `PowerPort` on the downstream
port, so the upstream port has no choice in the association.

Move this quirk from the association logic to the config parsing stage,
where it is isolated to the legacy config schema.

Tested: Topology Unit Tests Pass.

Change-Id: I5fb6c84eb71353e2b88b1c90b5ea739a6c44129b
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/src/entity_manager/topology.cpp b/src/entity_manager/topology.cpp
index c86e0e6..8f00ff4 100644
--- a/src/entity_manager/topology.cpp
+++ b/src/entity_manager/topology.cpp
@@ -76,6 +76,11 @@
     else if (exposesType.ends_with("Port"))
     {
         addPort(exposesType, path, assocContaining);
+
+        // this represents the legacy quirk of upstream ports having no choice
+        // in the
+        // powered_by association
+        addPort(exposesType, path, assocPoweredBy);
     }
     else
     {
@@ -182,10 +187,7 @@
                 const bool otherAgrees =
                     other.second.contains(assocName.getReverse());
 
-                // quirk: since the other side of the association cannot declare
-                // to be powered_by in the legacy schema, in case of "powering",
-                // the two associations do not have to agree.
-                if (!otherAgrees && assocName != assocPowering)
+                if (!otherAgrees)
                 {
                     continue;
                 }