Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 3f12f9e

Browse files
committed
createToken.py: Fix typo output_filename => input_filename
output_filename is not defined in else branch. Most likely author wanted to use input_filename instead
1 parent 9f67867 commit 3f12f9e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

kuksa_certificates/jwt/createToken.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#!/usr/bin/env python3
22

3-
# All rights reserved. This configuration file is provided to you under the
4-
# terms and conditions of the Eclipse Distribution License v1.0 which
5-
# accompanies this distribution, and is available at
6-
# http://www.eclipse.org/org/documents/edl-v10.php
3+
########################################################################
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
########################################################################
718

819
import argparse
920
import json
@@ -19,10 +30,7 @@ def createJWTToken(input_filename, priv_key):
1930

2031
encoded = jwt.encode(payload, priv_key, algorithm="RS256")
2132

22-
if input_filename.endswith(".json"):
23-
output_filename = input_filename[:-5] + ".token"
24-
else:
25-
output_filename = output_filename + ".token"
33+
output_filename = input_filename.removesuffix(".json") + ".token"
2634

2735
print("Writing signed access token to {}".format(output_filename))
2836
with open(output_filename, "w") as output:

0 commit comments

Comments
 (0)