add_host: check if name or hostname arg is provided
This commit is contained in:
parent
5f68892e81
commit
39d9496282
1 changed files with 6 additions and 0 deletions
|
@ -48,6 +48,12 @@ class ActionModule(ActionBase):
|
||||||
|
|
||||||
# Parse out any hostname:port patterns
|
# Parse out any hostname:port patterns
|
||||||
new_name = self._task.args.get('name', self._task.args.get('hostname', self._task.args.get('host', None)))
|
new_name = self._task.args.get('name', self._task.args.get('hostname', self._task.args.get('host', None)))
|
||||||
|
|
||||||
|
if new_name is None:
|
||||||
|
result['failed'] = True
|
||||||
|
result['msg'] = 'name or hostname arg needs to be provided'
|
||||||
|
return result
|
||||||
|
|
||||||
display.vv("creating host via 'add_host': hostname=%s" % new_name)
|
display.vv("creating host via 'add_host': hostname=%s" % new_name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue