util/create-schema-dspace.py: clean up output

Minor nitpick after staring at this while debugging for an hour. I
think the period at the end of these lines is ugly.
This commit is contained in:
Alan Orth 2022-01-11 20:50:17 +02:00
parent a063ec6143
commit 0fca6bbc90
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -47,7 +47,7 @@ def login(user, password):
try: try:
request = requests.post(rest_login_endpoint, headers=headers, data=data) request = requests.post(rest_login_endpoint, headers=headers, data=data)
except requests.ConnectionError: except requests.ConnectionError:
sys.stderr.write(f" Could not connect to REST API: {args.request_url}.\n") sys.stderr.write(f" Could not connect to REST API: {args.request_url}\n")
exit(1) exit(1)
@ -70,13 +70,13 @@ def check_session(sessionid):
try: try:
request = requests.get(request_url, headers=headers, cookies=cookies) request = requests.get(request_url, headers=headers, cookies=cookies)
except requests.ConnectionError: except requests.ConnectionError:
sys.stderr.write(f" Could not connect to REST API: {args.request_url}.\n") sys.stderr.write(f" Could not connect to REST API: {args.request_url}\n")
exit(1) exit(1)
if request.status_code == requests.codes.ok: if request.status_code == requests.codes.ok:
if not request.json()["authenticated"]: if not request.json()["authenticated"]:
sys.stderr.write(f" Session expired: {sessionid}.\n") sys.stderr.write(f" Session expired: {sessionid}\n")
exit(1) exit(1)
else: else:
@ -100,7 +100,7 @@ def create_schema(schema):
try: try:
request = requests.post(request_url, headers, json=schema, cookies=cookies) request = requests.post(request_url, headers, json=schema, cookies=cookies)
except requests.ConnectionError: except requests.ConnectionError:
sys.stderr.write(f" Could not connect to REST API: {args.request_url}.\n") sys.stderr.write(f" Could not connect to REST API: {args.request_url}\n")
exit(1) exit(1)