Fixes for unneeded abort if answer contained whitespace (#33)

This commit is contained in:
boltgolt 2018-06-28 14:43:50 +02:00
parent 5751650af3
commit cfa97b1ea7
No known key found for this signature in database
GPG key ID: BECEC9937E1AAE26
2 changed files with 2 additions and 2 deletions

2
debian/postinst vendored
View file

@ -187,7 +187,7 @@ if "HOWDY_NO_PROMPT" not in os.environ:
ans = input("Apply this change? [y/N]: ")
# Abort the whole thing if it's not
if (ans.lower() != "y"):
if ans.lower().strip() != "y" or ans.lower().strip() == "yes":
print("Interpreting as a \"NO\", aborting")
sys.exit(1)

2
debian/preinst vendored
View file

@ -89,7 +89,7 @@ for dev in devices:
os.killpg(os.getpgid(sub.pid), signal.SIGTERM)
# Set this camera as picked if the answer was yes, go to the next one if no
if ans.lower() == "y" or ans.lower() == "yes":
if ans.lower().strip() == "y" or ans.lower().strip() == "yes":
picked = dev[5:]
break
else: