1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Bug fixes for GCP modules (#54253)

This commit is contained in:
The Magician 2019-03-22 12:59:28 -07:00 committed by ansibot
parent 65f2bfc850
commit 59da779c41
6 changed files with 20 additions and 54 deletions

View file

@ -730,10 +730,10 @@ class ImageImageencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
class ImageRawdisk(object): class ImageRawdisk(object):
@ -764,10 +764,10 @@ class ImageSourcediskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -1298,14 +1298,10 @@ class InstanceDiskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict( return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key')})
{u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key'), u'sha256': self.request.get('sha256')}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict( return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey')})
{u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey'), u'sha256': self.request.get(u'sha256')}
)
class InstanceInitializeparams(object): class InstanceInitializeparams(object):
@ -1348,10 +1344,10 @@ class InstanceSourceimageencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
class InstanceGuestacceleratorsArray(object): class InstanceGuestacceleratorsArray(object):
@ -1406,7 +1402,6 @@ class InstanceNetworkinterfacesArray(object):
{ {
u'accessConfigs': InstanceAccessconfigsArray(item.get('access_configs', []), self.module).to_request(), u'accessConfigs': InstanceAccessconfigsArray(item.get('access_configs', []), self.module).to_request(),
u'aliasIpRanges': InstanceAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(), u'aliasIpRanges': InstanceAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(),
u'name': item.get('name'),
u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'),
u'networkIP': item.get('network_ip'), u'networkIP': item.get('network_ip'),
u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'), u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'),
@ -1418,7 +1413,6 @@ class InstanceNetworkinterfacesArray(object):
{ {
u'accessConfigs': InstanceAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(), u'accessConfigs': InstanceAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
u'aliasIpRanges': InstanceAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(), u'aliasIpRanges': InstanceAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(),
u'name': item.get(u'name'),
u'network': item.get(u'network'), u'network': item.get(u'network'),
u'networkIP': item.get(u'networkIP'), u'networkIP': item.get(u'networkIP'),
u'subnetwork': item.get(u'subnetwork'), u'subnetwork': item.get(u'subnetwork'),

View file

@ -537,32 +537,10 @@ class InstanceGroupManagerCurrentactions(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict( return remove_nones_from_dict({})
{
u'abandoning': self.request.get('abandoning'),
u'creating': self.request.get('creating'),
u'creatingWithoutRetries': self.request.get('creating_without_retries'),
u'deleting': self.request.get('deleting'),
u'none': self.request.get('none'),
u'recreating': self.request.get('recreating'),
u'refreshing': self.request.get('refreshing'),
u'restarting': self.request.get('restarting'),
}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict( return remove_nones_from_dict({})
{
u'abandoning': self.request.get(u'abandoning'),
u'creating': self.request.get(u'creating'),
u'creatingWithoutRetries': self.request.get(u'creatingWithoutRetries'),
u'deleting': self.request.get(u'deleting'),
u'none': self.request.get(u'none'),
u'recreating': self.request.get(u'recreating'),
u'refreshing': self.request.get(u'refreshing'),
u'restarting': self.request.get(u'restarting'),
}
)
class InstanceGroupManagerNamedportsArray(object): class InstanceGroupManagerNamedportsArray(object):

View file

@ -1237,14 +1237,10 @@ class InstanceTemplateDiskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict( return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key')})
{u'rawKey': self.request.get('raw_key'), u'rsaEncryptedKey': self.request.get('rsa_encrypted_key'), u'sha256': self.request.get('sha256')}
)
def from_response(self): def from_response(self):
return remove_nones_from_dict( return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey')})
{u'rawKey': self.request.get(u'rawKey'), u'rsaEncryptedKey': self.request.get(u'rsaEncryptedKey'), u'sha256': self.request.get(u'sha256')}
)
class InstanceTemplateInitializeparams(object): class InstanceTemplateInitializeparams(object):
@ -1291,10 +1287,10 @@ class InstanceTemplateSourceimageencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
class InstanceTemplateGuestacceleratorsArray(object): class InstanceTemplateGuestacceleratorsArray(object):
@ -1349,7 +1345,6 @@ class InstanceTemplateNetworkinterfacesArray(object):
{ {
u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get('access_configs', []), self.module).to_request(), u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get('access_configs', []), self.module).to_request(),
u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(), u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get('alias_ip_ranges', []), self.module).to_request(),
u'name': item.get('name'),
u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'), u'network': replace_resource_dict(item.get(u'network', {}), 'selfLink'),
u'networkIP': item.get('network_ip'), u'networkIP': item.get('network_ip'),
u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'), u'subnetwork': replace_resource_dict(item.get(u'subnetwork', {}), 'selfLink'),
@ -1361,7 +1356,6 @@ class InstanceTemplateNetworkinterfacesArray(object):
{ {
u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(), u'accessConfigs': InstanceTemplateAccessconfigsArray(item.get(u'accessConfigs', []), self.module).from_response(),
u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(), u'aliasIpRanges': InstanceTemplateAliasiprangesArray(item.get(u'aliasIpRanges', []), self.module).from_response(),
u'name': item.get(u'name'),
u'network': item.get(u'network'), u'network': item.get(u'network'),
u'networkIP': item.get(u'networkIP'), u'networkIP': item.get(u'networkIP'),
u'subnetwork': item.get(u'subnetwork'), u'subnetwork': item.get(u'subnetwork'),

View file

@ -484,10 +484,10 @@ class InterconnectAttachmentPrivateinterconnectinfo(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'tag8021q': self.request.get('tag8021q')}) return remove_nones_from_dict({})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'tag8021q': self.request.get(u'tag8021q')}) return remove_nones_from_dict({})
if __name__ == '__main__': if __name__ == '__main__':

View file

@ -585,10 +585,10 @@ class RegionDiskDiskencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
class RegionDiskSourcesnapshotencryptionkey(object): class RegionDiskSourcesnapshotencryptionkey(object):
@ -600,10 +600,10 @@ class RegionDiskSourcesnapshotencryptionkey(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'rawKey': self.request.get('raw_key'), u'sha256': self.request.get('sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get('raw_key')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey'), u'sha256': self.request.get(u'sha256')}) return remove_nones_from_dict({u'rawKey': self.request.get(u'rawKey')})
if __name__ == '__main__': if __name__ == '__main__':