-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix boolean defaults. #1343
Fix boolean defaults. #1343
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -35,7 +35,7 @@ | |||
required: true | ||||
force: | ||||
type: bool | ||||
default: "false" | ||||
default: false | ||||
description: | ||||
- Applicable only while removing the nodes from the pool. gluster | ||||
will refuse to detach a node from the pool if any one of the node | ||||
|
@@ -141,7 +141,7 @@ def call_peer_commands(self): | |||
def main(): | ||||
module = AnsibleModule( | ||||
argument_spec=dict( | ||||
force=dict(type='bool', required=False), | ||||
force=dict(type='bool', required=False, default=False), | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Force is only tested for truthy in
False and None are treated the same way.
|
||||
nodes=dict(type='list', required=True), | ||||
state=dict(type='str', choices=['absent', 'present'], | ||||
default='present'), | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,7 +270,7 @@ def main(): | |
|
||
apps=dict(default=None, required=False), | ||
cache_table=dict(default=None, required=False, type='str'), | ||
clear=dict(default=None, required=False, type='bool'), | ||
clear=dict(default=False, required=False, type='bool'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All options in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I think it is better to remove it, but other than that, using a default that is actually in the domain of values for the specified type does look better. |
||
database=dict(default=None, required=False, type='str'), | ||
failfast=dict(default=False, required=False, type='bool', aliases=['fail_fast']), | ||
fixtures=dict(default=None, required=False, type='str'), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait
is passed on intocloud_load_balancer
, and is there only tested for being truthy:community.general/plugins/modules/cloud/rackspace/rax_clb.py
Line 225 in f03ca81
community.general/plugins/modules/cloud/rackspace/rax_clb.py
Line 236 in f03ca81
community.general/plugins/modules/cloud/rackspace/rax_clb.py
Line 255 in f03ca81
Therefore
False
andNone
are treated the same way.