Running the `ceph_crush.py`, `ceph_key.py` or `ceph_volume.py` modules in check
mode resulted in the following error:
```
New-style module did not handle its own exit
```
This was due to the fact that they simply returned a `dict` in that case,
instead of calling `module.exit_json()`.
Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit
85dd4058145436e86a12ad9f015f5228189437d5)
changed=False,
stdout='',
stderr='',
- rc='',
+ rc=0,
start='',
end='',
delta='',
)
if module.check_mode:
- return result
+ module.exit_json(**result)
startd = datetime.datetime.now()
changed=changed,
stdout='',
stderr='',
- rc='',
+ rc=0,
start='',
end='',
delta='',
)
if module.check_mode:
- return result
+ module.exit_json(**result)
+
startd = datetime.datetime.now()
# will return either the image name or None
}
if module.check_mode:
- return dict(
+ module.exit_json(
changed=False,
stdout='',
stderr='',
- rc='',
+ rc=0,
start='',
end='',
delta='',
if __name__ == '__main__':
main()
-
changed=False,
stdout='',
stderr='',
- rc='',
+ rc=0,
start='',
end='',
delta='',
)
if module.check_mode:
- return result
+ module.exit_json(**result)
# start execution
startd = datetime.datetime.now()