remove unnecessary brackets in conditions (#10328)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run

* remove unnecessary brackets in conditions

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-07-03 16:46:50 +12:00 committed by GitHub
commit 682a89cdf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 88 additions and 56 deletions

View file

@ -501,13 +501,13 @@ class CloudflareAPI(object):
if (self.type == 'AAAA') and (self.value is not None):
self.value = self.value.lower()
if (self.type == 'SRV'):
if self.type == 'SRV':
if (self.proto is not None) and (not self.proto.startswith('_')):
self.proto = '_{0}'.format(self.proto)
if (self.service is not None) and (not self.service.startswith('_')):
self.service = '_{0}'.format(self.service)
if (self.type == 'TLSA'):
if self.type == 'TLSA':
if (self.proto is not None) and (not self.proto.startswith('_')):
self.proto = '_{0}'.format(self.proto)
if (self.port is not None):
@ -516,7 +516,7 @@ class CloudflareAPI(object):
if not self.record.endswith(self.zone):
self.record = join_str('.', self.record, self.zone)
if (self.type == 'DS'):
if self.type == 'DS':
if self.record == self.zone:
self.module.fail_json(msg="DS records only apply to subdomains.")
@ -722,7 +722,7 @@ class CloudflareAPI(object):
search_record = self.record
new_record = None
if (self.type in ['A', 'AAAA', 'CNAME', 'TXT', 'MX', 'NS', 'PTR']):
if self.type in ['A', 'AAAA', 'CNAME', 'TXT', 'MX', 'NS', 'PTR']:
if not self.value:
self.module.fail_json(msg="You must provide a non-empty value to create this record type")
@ -740,7 +740,7 @@ class CloudflareAPI(object):
"ttl": self.ttl
}
if (self.type in ['A', 'AAAA', 'CNAME']):
if self.type in ['A', 'AAAA', 'CNAME']:
new_record["proxied"] = self.proxied
if self.type == 'MX':
@ -873,7 +873,7 @@ class CloudflareAPI(object):
if ('proxied' in new_record) and ('proxied' in cur_record) and (cur_record['proxied'] != self.proxied):
do_update = True
if ('data' in new_record) and ('data' in cur_record):
if (cur_record['data'] != new_record['data']):
if cur_record['data'] != new_record['data']:
do_update = True
if (self.type == 'CNAME') and (cur_record['content'] != new_record['content']):
do_update = True