mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Bulk pep8 fixes - hand crafted (#33690)
* Bulk pep8 fixes - hand crafted Fix by hand the remaining issues that autopep8 couldn't * Next batch of hand crafted pep8 fixes * Ignore W503 https://github.com/PyCQA/pycodestyle/pull/499 * Revert more of W503
This commit is contained in:
parent
bcd189509e
commit
18529a275b
21 changed files with 57 additions and 87 deletions
|
@ -245,9 +245,9 @@ def aos_blueprint(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
try:
|
||||
my_blueprint = find_collection_item(aos.Blueprints,
|
||||
item_name=item_name,
|
||||
|
@ -255,9 +255,9 @@ def aos_blueprint(module):
|
|||
except:
|
||||
module.fail_json(msg="Unable to find the Blueprint based on name or ID, something went wrong")
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
ensure_absent(module, aos, my_blueprint)
|
||||
|
|
|
@ -158,9 +158,9 @@ def aos_device(module):
|
|||
elif margs['name'] is not None:
|
||||
item_name = margs['name']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
dev = find_collection_item(aos.Devices,
|
||||
item_name=item_name,
|
||||
item_id=item_id)
|
||||
|
@ -168,9 +168,9 @@ def aos_device(module):
|
|||
if dev.exists is False:
|
||||
module.fail_json(msg="unknown device '%s'" % margs['name'])
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Valid device state for reference
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# DEVICE_STATE_IS_ACTIVE = 1;
|
||||
# DEVICE_STATE_IS_READY = 2;
|
||||
# DEVICE_STATE_IS_NOCOMMS = 3;
|
||||
|
@ -184,9 +184,9 @@ def aos_device(module):
|
|||
# DEVICE_STATE_OOS_MAINT = 11;
|
||||
# DEVICE_STATE_OOS_REBOOTING = 12;
|
||||
# DEVICE_STATE_ERROR = 13;
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# State == Normal
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'normal':
|
||||
aos_device_normal(module, aos, dev)
|
||||
|
||||
|
|
|
@ -288,9 +288,9 @@ def ext_router(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
try:
|
||||
my_ext_router = find_collection_item(aos.ExternalRouters,
|
||||
item_name=item_name,
|
||||
|
@ -298,9 +298,9 @@ def ext_router(module):
|
|||
except:
|
||||
module.fail_json(msg="Unable to find the IP Pool based on name or ID, something went wrong")
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
ext_router_absent(module, aos, my_ext_router)
|
||||
|
|
|
@ -300,9 +300,9 @@ def ip_pool(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
try:
|
||||
my_pool = find_collection_item(aos.IpPools,
|
||||
item_name=item_name,
|
||||
|
@ -310,9 +310,9 @@ def ip_pool(module):
|
|||
except:
|
||||
module.fail_json(msg="Unable to find the IP Pool based on name or ID, something went wrong")
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
ip_pool_absent(module, aos, my_pool)
|
||||
|
|
|
@ -214,16 +214,16 @@ def logical_device(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
my_logical_dev = find_collection_item(aos.LogicalDevices,
|
||||
item_name=item_name,
|
||||
item_id=item_id)
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
logical_device_absent(module, aos, my_logical_dev)
|
||||
|
|
|
@ -234,9 +234,9 @@ def logical_device_map(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
try:
|
||||
my_log_dev_map = find_collection_item(aos.LogicalDeviceMaps,
|
||||
item_name=item_name,
|
||||
|
@ -244,9 +244,9 @@ def logical_device_map(module):
|
|||
except:
|
||||
module.fail_json(msg="Unable to find the Logical Device Map based on name or ID, something went wrong")
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
logical_device_map_absent(module, aos, my_log_dev_map)
|
||||
|
|
|
@ -211,16 +211,16 @@ def rack_type(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
my_rack_type = find_collection_item(aos.RackTypes,
|
||||
item_name=item_name,
|
||||
item_id=item_id)
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
rack_type_absent(module, aos, my_rack_type)
|
||||
|
|
|
@ -225,9 +225,9 @@ def aos_template(module):
|
|||
elif margs['id'] is not None:
|
||||
item_id = margs['id']
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Find Object if available based on ID or Name
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
try:
|
||||
my_template = find_collection_item(aos.DesignTemplates,
|
||||
item_name=item_name,
|
||||
|
@ -235,9 +235,9 @@ def aos_template(module):
|
|||
except:
|
||||
module.fail_json(msg="Unable to find the IP Pool based on name or ID, something went wrong")
|
||||
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
# Proceed based on State value
|
||||
#----------------------------------------------------
|
||||
# ----------------------------------------------------
|
||||
if margs['state'] == 'absent':
|
||||
|
||||
template_absent(module, aos, my_template)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue