1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-12 23:15:06 +00:00

Reformat everything.

This commit is contained in:
Felix Fontein 2025-11-01 12:08:41 +01:00
parent 3f2213791a
commit 340ff8586d
1008 changed files with 61301 additions and 58309 deletions

View file

@ -81,36 +81,35 @@ from ansible_collections.community.general.plugins.module_utils.oneview import O
class FcoeNetworkModule(OneViewModuleBase):
MSG_CREATED = 'FCoE Network created successfully.'
MSG_UPDATED = 'FCoE Network updated successfully.'
MSG_DELETED = 'FCoE Network deleted successfully.'
MSG_ALREADY_PRESENT = 'FCoE Network is already present.'
MSG_ALREADY_ABSENT = 'FCoE Network is already absent.'
RESOURCE_FACT_NAME = 'fcoe_network'
MSG_CREATED = "FCoE Network created successfully."
MSG_UPDATED = "FCoE Network updated successfully."
MSG_DELETED = "FCoE Network deleted successfully."
MSG_ALREADY_PRESENT = "FCoE Network is already present."
MSG_ALREADY_ABSENT = "FCoE Network is already absent."
RESOURCE_FACT_NAME = "fcoe_network"
def __init__(self):
additional_arg_spec = dict(data=dict(required=True, type='dict'),
state=dict(default='present',
choices=['present', 'absent']))
additional_arg_spec = dict(
data=dict(required=True, type="dict"), state=dict(default="present", choices=["present", "absent"])
)
super().__init__(additional_arg_spec=additional_arg_spec, validate_etag_support=True)
self.resource_client = self.oneview_client.fcoe_networks
def execute_module(self):
resource = self.get_by_name(self.data.get('name'))
resource = self.get_by_name(self.data.get("name"))
if self.state == 'present':
if self.state == "present":
return self.__present(resource)
elif self.state == 'absent':
elif self.state == "absent":
return self.resource_absent(resource)
def __present(self, resource):
scope_uris = self.data.pop('scopeUris', None)
scope_uris = self.data.pop("scopeUris", None)
result = self.resource_present(resource, self.RESOURCE_FACT_NAME)
if scope_uris is not None:
result = self.resource_scopes_set(result, 'fcoe_network', scope_uris)
result = self.resource_scopes_set(result, "fcoe_network", scope_uris)
return result
@ -118,5 +117,5 @@ def main():
FcoeNetworkModule().run()
if __name__ == '__main__':
if __name__ == "__main__":
main()