mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Clean up some required argument logic
This commit is contained in:
parent
db5f2bf3df
commit
3a46c79451
2 changed files with 6 additions and 7 deletions
|
@ -104,7 +104,7 @@ def rax_keypair(module, name, public_key, state):
|
|||
keypair = {}
|
||||
|
||||
if state == 'present':
|
||||
if os.path.isfile(public_key):
|
||||
if public_key and os.path.isfile(public_key):
|
||||
try:
|
||||
f = open(public_key)
|
||||
public_key = f.read()
|
||||
|
@ -143,7 +143,7 @@ def main():
|
|||
argument_spec = rax_argument_spec()
|
||||
argument_spec.update(
|
||||
dict(
|
||||
name=dict(),
|
||||
name=dict(required=True),
|
||||
public_key=dict(),
|
||||
state=dict(default='present', choices=['absent', 'present']),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue