nuagenetworks / nuage-metroae-config

Nuage Networks MetroAE Configuration Template Engine
Apache License 2.0
2 stars 0 forks source link

Add CSP root enterprise as a virtual object #40

Closed mpiecuch-nuage closed 3 years ago

mpiecuch-nuage commented 3 years ago

PASSES: Python2 unit-tests Python3 unit-tests (except for error from base64 in review #39 ) http://135.227.221.130:8080/job/gcp/job/INSTALL-GCP-SA-E2E/103/

Apparently, the "CSP" enterprise exists on the VSD but is not accessible in any way that I can find. This is problematic since the config engine needs to be able to select it to use as a parent for a series of legitimate other objects nested underneath. Given that we know its hard-coded id and name, I am making a change to the config engine to "virtually" be able to select it. I am inserting in the bambou_adapter (our interface into VSPK) a check any time enterprises are fetched. If the templates (or query tool) selects an enterprise by name "CSP" or by the hard-coded id, the engine will construct a suitable enterprise on its own without contacting the VSD. This also happens if all enterprises are fetched, this special one is automatically appended to the list without contacting the VSD.

So what this does is trick the rest of the system into thinking that this special enterprise was successfully found, even though we just injected it in without help from the VSD. It seems to work seamlessly. I modified the group binding template to select the "CSP" enterprise and I was able to do the assignment without error. I am also able to do queries with the query tool on objects under the CSP enterprise. This "virtual" enterprise is only going to be available in the next engine version, so that is why I added the "1.1.0" engine version requirement for the template.