mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-17 22:01:07 -07:00
Fix galaxy roles_path cli usage.
If we specify a roles_path from the cli, use a optparse action callback to make sure the roles_path is set to a path list. Fixes #15255
This commit is contained in:
parent
03300e99ac
commit
05b46091e4
4 changed files with 25 additions and 6 deletions
|
@ -120,7 +120,11 @@ class GalaxyCLI(CLI):
|
|||
|
||||
# options that apply to more than one action
|
||||
if not self.action in ("delete","import","init","login","setup"):
|
||||
self.parser.add_option('-p', '--roles-path', dest='roles_path', default=C.DEFAULT_ROLES_PATH,
|
||||
# NOTE: while the option type=str, the default is a list, and the
|
||||
# callback will set the value to a list.
|
||||
self.parser.add_option('-p', '--roles-path', dest='roles_path',
|
||||
action="callback", callback=CLI.expand_paths,
|
||||
type=str, default=C.DEFAULT_ROLES_PATH,
|
||||
help='The path to the directory containing your roles. '
|
||||
'The default is the roles_path configured in your '
|
||||
'ansible.cfg file (/etc/ansible/roles if not configured)')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue