Skip to content

Commit

Permalink
Ran autopep8 (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Jan 19, 2024
1 parent fb0cd35 commit 0114860
Show file tree
Hide file tree
Showing 197 changed files with 2,935 additions and 1,774 deletions.
3 changes: 2 additions & 1 deletion allTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Copyright (c) ZeroC, Inc. All rights reserved.
#

import os, sys
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "scripts"))

from Util import runTests
Expand Down
21 changes: 15 additions & 6 deletions certs/makecerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Copyright (c) ZeroC, Inc. All rights reserved.
#

import os, sys, socket, getopt
import os
import sys
import socket
import getopt

try:
import IceCertUtils
Expand All @@ -12,6 +15,7 @@
"package from the Python package repository?\nerror: " + str(ex))
sys.exit(1)


def usage():
print("Usage: " + sys.argv[0] + " [options]")
print("")
Expand All @@ -21,9 +25,10 @@ def usage():
print("--ip <ip> The IP address for the server certificate.")
print("--dns <dns> The DNS name for the server certificate.")
print("--use-dns Use the DNS name for the server certificate common")
print(" name (default is to use the IP address)." )
print(" name (default is to use the IP address).")
sys.exit(1)


#
# Check arguments
#
Expand All @@ -33,7 +38,7 @@ def usage():
usedns = False
impl = ""
try:
opts, args = getopt.getopt(sys.argv[1:], "hd", ["help", "debug", "ip=", "dns=","use-dns","impl="])
opts, args = getopt.getopt(sys.argv[1:], "hd", ["help", "debug", "ip=", "dns=", "use-dns", "impl="])
except getopt.GetoptError as e:
print("Error %s " % e)
usage()
Expand All @@ -54,6 +59,7 @@ def usage():
elif o == "--impl":
impl = a


def request(question, newvalue, value):
while True:
sys.stdout.write(question)
Expand All @@ -66,6 +72,7 @@ def request(question, newvalue, value):
else:
return value


#
# Change to the directory where the certs files are stored
#
Expand Down Expand Up @@ -103,7 +110,7 @@ def request(question, newvalue, value):
#
# NOTE: server.pem is used by scripts/TestController.py
#
server = factory.create("server", cn = (dns if usedns else ip), ip=ip, dns=dns, extendedKeyUsage="serverAuth,clientAuth")
server = factory.create("server", cn=(dns if usedns else ip), ip=ip, dns=dns, extendedKeyUsage="serverAuth,clientAuth")
server.save("server.p12").save("server.pem")

try:
Expand All @@ -116,13 +123,15 @@ def request(question, newvalue, value):
client.save("client.bks", caalias="cacert")
except Exception as ex:
for f in ["server.bks", "client.bks"]:
if os.path.exists(f): os.remove(f)
if os.path.exists(f):
os.remove(f)
print("warning: couldn't generate BKS certificates for Android applications:\n" + str(ex))
print("Please fix this issue if you want to run the Android tests.")

except Exception as ex:
for f in ["server.jks", "client.jks"]:
if os.path.exists(f): os.remove(f)
if os.path.exists(f):
os.remove(f)
print("warning: couldn't generate JKS certificates for Java applications:\n" + str(ex))
print("Please fix this issue if you want to run the Java tests.")

Expand Down
Loading

0 comments on commit 0114860

Please sign in to comment.