Skip to content

Commit

Permalink
[azure][fix] SubResources are also Resources (#1830)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Nov 20, 2023
1 parent 1d842a4 commit fe2e4a6
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 65 deletions.
169 changes: 107 additions & 62 deletions plugins/azure/resoto_plugin_azure/resource/network.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions plugins/azure/test/files/network/natGateways.json
@@ -0,0 +1 @@
{ "value": []}
1 change: 1 addition & 0 deletions plugins/azure/test/files/network/networkInterfaces.json
@@ -0,0 +1 @@
{ "value": []}
@@ -0,0 +1 @@
{ "value": []}
1 change: 1 addition & 0 deletions plugins/azure/test/files/network/privateLinkServices.json
@@ -0,0 +1 @@
{ "value": []}
1 change: 1 addition & 0 deletions plugins/azure/test/files/network/publicIPAddresses.json
@@ -0,0 +1 @@
{ "value": []}
1 change: 1 addition & 0 deletions plugins/azure/test/files/network/virtualNetworkTaps.json
@@ -0,0 +1 @@
{ "value": []}
8 changes: 5 additions & 3 deletions plugins/azure/tools/azure_model_gen.py
Expand Up @@ -243,12 +243,14 @@ def class_method(
unfold_props = (unfold_properties or set()) | {"properties"} # always unfold properties

def add_types(acs: Dict[str, AzureClassModel]) -> None:
result.update(acs)
for k, v in acs.items():
if k not in result:
result[k] = v

if "properties" in shape or "allOf" in shape:
name = type_name(shape)
if name in result:
return {}
# if name in result:
# return {}
props: Dict[str, AzureProperty] = {}
bases: List[str] = []
existing_ignored: Dict[str, AzureProperty] = {}
Expand Down

0 comments on commit fe2e4a6

Please sign in to comment.