Sketch in Management Group integration for Azure

Add mocks and real implementations for creating nested management groups that reflect the Portfolio->Application->Environment->Subscription hierarchy.
This commit is contained in:
tomdds
2019-12-09 14:00:36 -05:00
committed by dandds
parent 2801e07454
commit 8a1ed5b193
3 changed files with 159 additions and 38 deletions

View File

@@ -10,9 +10,9 @@ AZURE_CONFIG = {
}
AUTH_CREDENTIALS = {
"CLIENT_ID": AZURE_CONFIG["AZURE_CLIENT_ID"],
"SECRET_KEY": AZURE_CONFIG["AZURE_SECRET_KEY"],
"TENANT_ID": AZURE_CONFIG["AZURE_TENANT_ID"],
"client_id": AZURE_CONFIG["AZURE_CLIENT_ID"],
"secret_key": AZURE_CONFIG["AZURE_SECRET_KEY"],
"tenant_id": AZURE_CONFIG["AZURE_TENANT_ID"],
}
@@ -28,6 +28,12 @@ def mock_authorization():
return Mock(spec=authorization)
def mock_managementgroups():
from azure.mgmt import managementgroups
return Mock(spec=managementgroups)
def mock_graphrbac():
import azure.graphrbac as graphrbac
@@ -46,6 +52,7 @@ class MockAzureSDK(object):
self.subscription = mock_subscription()
self.authorization = mock_authorization()
self.managementgroups = mock_managementgroups()
self.graphrbac = mock_graphrbac()
self.credentials = mock_credentials()
# may change to a JEDI cloud