File ac_avoid_isclose.patch of Package azure-cli.30411

diff -Nru azure-cli-2.17.1.orig/azure/cli/command_modules/acs/_validators.py azure-cli-2.17.1/azure/cli/command_modules/acs/_validators.py
--- azure-cli-2.17.1.orig/azure/cli/command_modules/acs/_validators.py	2020-12-31 09:24:48.000000000 +0100
+++ azure-cli-2.17.1/azure/cli/command_modules/acs/_validators.py	2023-08-28 13:59:54.172210849 +0200
@@ -7,7 +7,7 @@
 import os
 import os.path
 import re
-from math import isnan, isclose
+from math import isnan
 from ipaddress import ip_network
 
 # pylint: disable=no-name-in-module,import-error
@@ -285,7 +285,8 @@
             raise CLIError("--spot_max_price can only be set when --priority is Spot")
         if len(str(namespace.spot_max_price).split(".")) > 1 and len(str(namespace.spot_max_price).split(".")[1]) > 5:
             raise CLIError("--spot_max_price can only include up to 5 decimal places")
-        if namespace.spot_max_price <= 0 and not isclose(namespace.spot_max_price, -1.0, rel_tol=1e-06):
+        if namespace.spot_max_price <= 0 and not (abs(namespace.spot_max_price-(-1.0)) <= \
+                max(1e-06 * max(abs(namespace.spot_max_price), abs(-1.0)), 0.0)):
             raise CLIError(
                 "--spot_max_price can only be any decimal value greater than zero, or -1 which indicates "
                 "default price to be up-to on-demand")
openSUSE Build Service is sponsored by