Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran autopep8 #1698

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ran autopep8
externl committed Jan 19, 2024
commit 7f2d5eca0c1ea7d7cd648c8397250da2aa418180
3 changes: 2 additions & 1 deletion allTests.py
Original file line number Diff line number Diff line change
@@ -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
21 changes: 15 additions & 6 deletions certs/makecerts.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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("")
@@ -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
#
@@ -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()
@@ -54,6 +59,7 @@ def usage():
elif o == "--impl":
impl = a


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


#
# Change to the directory where the certs files are stored
#
@@ -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:
@@ -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.")

Loading
Loading