Skip to content

Commit 1afad0e

Browse files
committed
removed un-needed f-strings, added note for SSL
1 parent 9ea0ace commit 1afad0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
con = sqlite3.connect(":memory:")
99
cur = con.cursor()
10+
# Ignoring warnings for local certs. Remove this if using external secure connection, instead of cluster internal one
1011
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
1112

1213

@@ -23,8 +24,8 @@
2324

2425

2526
def check_rancher_status():
26-
2727
try:
28+
# Ignoring warnings for local certs. Remove verify=False if using external secure connection, instead of cluster internal one
2829
request_response = requests.request("GET", RANCHER_URL, data=payload, headers=headersList, verify=False)
2930
except requests.exceptions.ConnectionError as e:
3031
raise SystemExit(f'FATAL ERROR: {e}\n Cannot connect to rancher URL')
@@ -44,7 +45,7 @@ def check_rancher_status():
4445
if check_exists == 0:
4546
cur.execute("INSERT INTO clusters VALUES (?, ?, ?)", (cluster_name, cluster_status, ''))
4647
else:
47-
cur.execute("UPDATE clusters SET ready = ? where name = ?", (f"{cluster_status}", f"{cluster_name}"))
48+
cur.execute("UPDATE clusters SET ready = ? where name = ?", (cluster_status, cluster_name))
4849
except KeyError as e:
4950
raise SystemExit(f'FATAL ERROR: {e}\n Rancher api data cannot be parsed, check token')
5051

0 commit comments

Comments
 (0)