mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-22 02:41:23 -07:00
Formatting changes related to upstream code generator cleanup. (#162)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
f2746afceb
commit
99d5da337c
94 changed files with 1515 additions and 1845 deletions
|
@ -215,11 +215,9 @@ def main():
|
|||
ipv4_range=dict(type='str'),
|
||||
name=dict(required=True, type='str'),
|
||||
auto_create_subnetworks=dict(type='bool'),
|
||||
routing_config=dict(type='dict', options=dict(
|
||||
routing_mode=dict(required=True, type='str', choices=['REGIONAL', 'GLOBAL'])
|
||||
))
|
||||
routing_config=dict(type='dict', options=dict(routing_mode=dict(required=True, type='str', choices=['REGIONAL', 'GLOBAL']))),
|
||||
),
|
||||
mutually_exclusive=[['auto_create_subnetworks', 'ipv4_range']]
|
||||
mutually_exclusive=[['auto_create_subnetworks', 'ipv4_range']],
|
||||
)
|
||||
|
||||
if not module.params['scopes']:
|
||||
|
@ -275,7 +273,7 @@ def resource_to_request(module):
|
|||
u'IPv4Range': module.params.get('ipv4_range'),
|
||||
u'name': module.params.get('name'),
|
||||
u'autoCreateSubnetworks': module.params.get('auto_create_subnetworks'),
|
||||
u'routingConfig': NetworkRoutingconfig(module.params.get('routing_config', {}), module).to_request()
|
||||
u'routingConfig': NetworkRoutingconfig(module.params.get('routing_config', {}), module).to_request(),
|
||||
}
|
||||
return_vals = {}
|
||||
for k, v in request.items():
|
||||
|
@ -349,7 +347,7 @@ def response_to_hash(module, response):
|
|||
u'subnetworks': response.get(u'subnetworks'),
|
||||
u'autoCreateSubnetworks': module.params.get('auto_create_subnetworks'),
|
||||
u'creationTimestamp': response.get(u'creationTimestamp'),
|
||||
u'routingConfig': NetworkRoutingconfig(response.get(u'routingConfig', {}), module).from_response()
|
||||
u'routingConfig': NetworkRoutingconfig(response.get(u'routingConfig', {}), module).from_response(),
|
||||
}
|
||||
|
||||
|
||||
|
@ -397,14 +395,10 @@ class NetworkRoutingconfig(object):
|
|||
self.request = {}
|
||||
|
||||
def to_request(self):
|
||||
return remove_nones_from_dict({
|
||||
u'routingMode': self.request.get('routing_mode')
|
||||
})
|
||||
return remove_nones_from_dict({u'routingMode': self.request.get('routing_mode')})
|
||||
|
||||
def from_response(self):
|
||||
return remove_nones_from_dict({
|
||||
u'routingMode': self.request.get(u'routingMode')
|
||||
})
|
||||
return remove_nones_from_dict({u'routingMode': self.request.get(u'routingMode')})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue