Groups
Groups
Sign in
Groups
Groups
python-doit
Conversations
About
Send feedback
Help
how to use flag in actions
9 views
Skip to first unread message
Vikas Kumar
unread,
Dec 20, 2020, 7:12:56 AM
12/20/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-doit
I am looking to use the flag such that
doit tf_init
runs
terraform init
command
and
doit tf_init --upgrade
runs
terraform init -upgrade
command
This is my pseudo code
def task_tf_init():
def _task(flag):
if flag:
return '-upgrade'
else:
return ''
return
{
'params': [{
'name': 'flag',
'long': 'upgrade',
'short': 'u',
'type': bool,
'default': False,
'inverse': 'upgrade'}],
'actions': [f'terraform init {(_task, )}',],
'verbosity': 2,
}
Reply all
Reply to author
Forward
0 new messages