Use literal string interpolation in core (f-strings) (#26166)

This commit is contained in:
Franck Nijhof authored and Paulus Schoutsen committed 2019-08-23 09:53:33 -07:00
1 parent 1efa29d6ff
commit decf13b948
67 files changed
+180 -246

No files matched your search

+5 -7
View File
@@ -58,20 +58,18 @@ def run(args):
if args.value:
the_secret = args.value
else:
the_secret = getpass.getpass(
"Please enter the secret for {}: ".format(args.name)
)
the_secret = getpass.getpass(f"Please enter the secret for {args.name}: ")
current_version = credstash.getHighestVersion(args.name, table=table)
credstash.putSecret(
args.name, the_secret, version=int(current_version) + 1, table=table
)
print("Secret {} put successfully".format(args.name))
print(f"Secret {args.name} put successfully")
elif args.action == "get":
the_secret = credstash.getSecret(args.name, table=table)
if the_secret is None:
print("Secret {} not found".format(args.name))
print(f"Secret {args.name} not found")
else:
print("Secret {}={}".format(args.name, the_secret))
print(f"Secret {args.name}={the_secret}")
elif args.action == "del":
credstash.deleteSecrets(args.name, table=table)
print("Deleted secret {}".format(args.name))
print(f"Deleted secret {args.name}")