forked from pool/python-softlayer
* Added feature to iter_call to force a orderBy filter * Fixed an issues with search command. * Added --owner, --public_ip and --private_ip search fields for hardware list * Added get_total_items to SoftLayerListResult. * Fixed invalid filter in vs migrate preventing guest list from being properly shown. * Sums up child items in invoices-detail * Updated vlan masks to fix id/number fields not being retrieved properly * Added x509 certificate support to cli * Added vpn status to user list. * Fixed a bug when displaying empty tables. * Added more error handling around table output * Reworked user permissions list to include permissions * More efficient created_by * Fixed a bug in the config parser * Fixed an issue with confirmation not handling uppercase ids * Removed requirements in volume-modify commands * Marked --crt and --key as required for slcli ssl add * Added network flag to update-firmware * Added detect-secrets workflow * Added support for python 3.12 * Adding support for internal styles of authentication - Add patch support-click-8.2.patch: * Support changes that Click 8.2 made. - Switch to pyproject macros. - No more greedy globs in %files. - Package should be noarch. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-softlayer?expand=0&rev=41
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
From d92d20a97ac8e65524ccbfd7487d9c8899948544 Mon Sep 17 00:00:00 2001
|
|
From: Steve Kowalik <steven@wedontsleep.org>
|
|
Date: Thu, 22 May 2025 15:29:56 +0200
|
|
Subject: [PATCH] Support Click 8.2+
|
|
|
|
Click 8.2 and above will now force an abort if a confirmation prompt
|
|
isn't answered, rather than raising the CLIAbort that is expected. Catch
|
|
this exception so that our own exceptions are raised.
|
|
---
|
|
SoftLayer/CLI/formatting.py | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/SoftLayer/CLI/formatting.py b/SoftLayer/CLI/formatting.py
|
|
index b9eca571e..b4c9a98f7 100644
|
|
--- a/SoftLayer/CLI/formatting.py
|
|
+++ b/SoftLayer/CLI/formatting.py
|
|
@@ -260,7 +260,10 @@ def no_going_back(confirmation):
|
|
|
|
prompt = f"This action cannot be undone! Type '{confirmation}' or press Enter to abort"
|
|
|
|
- ans = click.prompt(prompt, default='', show_default=False)
|
|
+ try:
|
|
+ ans = click.prompt(prompt, default='', show_default=False)
|
|
+ except click.exceptions.Abort:
|
|
+ return False
|
|
if ans.lower() == str(confirmation).lower():
|
|
return True
|
|
|