Skip to content

Commit 69182a0

Browse files
committed
Drop default from ask_user_yesno question
There is no default for ask_user_yesno() since an empty answer instead just repeats the question. Drop the unnecessary parameter. Change-Id: I207bccbcbd31f831765e74a20c503b695790c0f5
1 parent 348eb79 commit 69182a0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

openstackclient/common/project_cleanup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@
2828
LOG = logging.getLogger(__name__)
2929

3030

31-
def ask_user_yesno(msg, default=True):
31+
def ask_user_yesno(msg):
3232
"""Ask user Y/N question
3333
3434
:param str msg: question text
35-
:param bool default: default value
3635
:return bool: User choice
3736
"""
3837
while True:
3938
answer = getpass._raw_input(
40-
'{} [{}]: '.format(msg, 'y/N' if not default else 'Y/n'))
39+
'{} [{}]: '.format(msg, 'y/n'))
4140
if answer in ('y', 'Y', 'yes'):
4241
return True
4342
elif answer in ('n', 'N', 'no'):
@@ -129,8 +128,7 @@ def take_action(self, parsed_args):
129128
return
130129

131130
confirm = ask_user_yesno(
132-
_("These resources will be deleted. Are you sure"),
133-
default=False)
131+
_("These resources will be deleted. Are you sure"))
134132

135133
if confirm:
136134
self.log.warning(_('Deleting resources'))

0 commit comments

Comments
 (0)