Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <jenright@cloudera.com>
  • Loading branch information
jimright committed Oct 4, 2024
1 parent 00d48f2 commit d5fbd4b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions plugins/modules/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,11 +741,12 @@ def __init__(self, module):

@CdpModule._Decorators.process_debug
def process(self):

# Check parameters that should only specified with freeipa upgrade
if self.freeipa["upgrade"] == None and (self.freeipa['image_id']):
self.module.fail_json(
msg="FreeIPA image Id should only be specified during FreeIPA upgrade")
if self.freeipa["upgrade"] == None and (self.freeipa["image_id"]):
self.module.fail_json(
msg="FreeIPA image Id should only be specified during FreeIPA upgrade"
)

existing = self.cdpy.environments.describe_environment(self.name)

Expand All @@ -758,13 +759,15 @@ def process(self):
self.environment = existing

# For upgrade confirm combination of declared actions are possible
if (existing["status"] in self.cdpy.sdk.STOPPED_STATES and
not self.wait and
self.freeipa["upgrade"] != None):

if (
existing["status"] in self.cdpy.sdk.STOPPED_STATES
and not self.wait
and self.freeipa["upgrade"] != None
):

self.module.fail_json(
msg="Unable to start and upgrade a stopped environment without waiting for completion of start."
)
msg="Unable to start and upgrade a stopped environment without waiting for completion of start."
)

# Reconcile if specifying cloud parameters
if self.cloud is not None:
Expand Down Expand Up @@ -903,7 +906,6 @@ def process(self):
msg="Attempting to stop a failed environment", **existing
)


# Otherwise, stop the environment
else:
if not self.module.check_mode:
Expand Down Expand Up @@ -994,7 +996,7 @@ def upgrade_freeipa(self, wait):
state=["AVAILABLE"],
delay=self.delay,
timeout=self.timeout,
state_confirmation_retries=3
state_confirmation_retries=3,
)
else:
self.module.warn("No FreeIPA upgrades available.")
Expand Down

0 comments on commit d5fbd4b

Please # to comment.