diff options
author | Dr. Jens Harbott <harbott@osism.tech> | 2022-12-27 11:20:05 +0100 |
---|---|---|
committer | Dr. Jens Harbott <harbott@osism.tech> | 2022-12-27 13:03:14 +0100 |
commit | 69182a04b223824b5da1aeca253c815a9affedbc (patch) | |
tree | ece664011e52dbec2d7b641de2e1acbfd6e613d2 /openstackclient | |
parent | 348eb796321c8475af73b727a310c3a09f519ffa (diff) | |
download | python-openstackclient-69182a04b223824b5da1aeca253c815a9affedbc.tar.gz |
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
Diffstat (limited to 'openstackclient')
-rw-r--r-- | openstackclient/common/project_cleanup.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/openstackclient/common/project_cleanup.py b/openstackclient/common/project_cleanup.py index f2536354..1479f1a4 100644 --- a/openstackclient/common/project_cleanup.py +++ b/openstackclient/common/project_cleanup.py @@ -28,16 +28,15 @@ from openstackclient.identity import common as identity_common LOG = logging.getLogger(__name__) -def ask_user_yesno(msg, default=True): +def ask_user_yesno(msg): """Ask user Y/N question :param str msg: question text - :param bool default: default value :return bool: User choice """ while True: answer = getpass._raw_input( - '{} [{}]: '.format(msg, 'y/N' if not default else 'Y/n')) + '{} [{}]: '.format(msg, 'y/n')) if answer in ('y', 'Y', 'yes'): return True elif answer in ('n', 'N', 'no'): @@ -129,8 +128,7 @@ class ProjectCleanup(command.Command): return confirm = ask_user_yesno( - _("These resources will be deleted. Are you sure"), - default=False) + _("These resources will be deleted. Are you sure")) if confirm: self.log.warning(_('Deleting resources')) |