openssl_*: prevent error when path includes no path (#50322)
* Prevent error when path includes no path. * Add changelog.
This commit is contained in:
parent
a5bf71ac6a
commit
5c5cd2dc4d
7 changed files with 8 additions and 6 deletions
2
changelogs/fragments/50322-openssl-path-error.yml
Normal file
2
changelogs/fragments/50322-openssl-path-error.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "openssl_* - fix error when ``path`` contains a file name without path."
|
|
@ -1041,7 +1041,7 @@ def main():
|
|||
if module.params['provider'] != 'assertonly' and module.params['csr_path'] is None:
|
||||
module.fail_json(msg='csr_path is required when provider is not assertonly')
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(
|
||||
name=base_dir,
|
||||
|
|
|
@ -563,7 +563,7 @@ def main():
|
|||
except AttributeError:
|
||||
module.fail_json(msg='You need to have PyOpenSSL>=0.15 to generate CSRs')
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(name=base_dir, msg='The directory %s does not exist or the file is not a directory' % base_dir)
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ def main():
|
|||
add_file_common_args=True,
|
||||
)
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(
|
||||
name=base_dir,
|
||||
|
|
|
@ -312,7 +312,7 @@ def main():
|
|||
if not pyopenssl_found:
|
||||
module.fail_json(msg='The python pyOpenSSL library is required')
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(
|
||||
name=base_dir,
|
||||
|
|
|
@ -582,7 +582,7 @@ def main():
|
|||
],
|
||||
)
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(
|
||||
name=base_dir,
|
||||
|
|
|
@ -269,7 +269,7 @@ def main():
|
|||
if not pyopenssl_found:
|
||||
module.fail_json(msg='the python pyOpenSSL module is required')
|
||||
|
||||
base_dir = os.path.dirname(module.params['path'])
|
||||
base_dir = os.path.dirname(module.params['path']) or '.'
|
||||
if not os.path.isdir(base_dir):
|
||||
module.fail_json(
|
||||
name=base_dir,
|
||||
|
|
Loading…
Reference in a new issue