Skip to content

Commit 43f04c8

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Drop default from ask_user_yesno question"
2 parents cfd7281 + 69182a0 commit 43f04c8

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)