Skip to content

Commit ba5f2af

Browse files
committed
Merge branch 'main' into iri_client_new
2 parents ebaf0fd + 19c1e0d commit ba5f2af

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

dashboard/app.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from parameters_manager import ParametersManager
1313
from calibration_manager import SimulationCalibrationManager
1414
from hpc_manager import load_hpc_card
15-
from sfapi_manager import initialize_sfapi
1615
from state_manager import server, state, ctrl, initialize_state
1716
from error_manager import error_panel, add_error
1817
from utils import (
@@ -481,8 +480,6 @@ def gui_setup():
481480
if __name__ == "__main__":
482481
# initialize state variables needed at startup
483482
initialize_state()
484-
# initialize Superfacility API
485-
initialize_sfapi()
486483
# update for the first time
487484
update()
488485
# start server

dashboard/sfapi_manager.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from datetime import datetime
2-
import os
32
from sfapi_client import Client
43
from sfapi_client.compute import Machine
54
from trame.widgets import vuetify3 as vuetify
@@ -36,26 +35,6 @@ def parse_sfapi_key(key_str):
3635
state.sfapi_key = "".join(key_lines)
3736

3837

39-
def initialize_sfapi():
40-
print("Initializing Superfacility API...")
41-
# look for a key file in the current directory
42-
key_path = os.path.join(os.getcwd(), "priv_key.pem")
43-
if os.path.isfile(key_path):
44-
try:
45-
with Client(key=key_path) as client:
46-
# store the whole content of the key file in a string
47-
key_str = client._secret
48-
# store the client ID and key in the respective state variables
49-
parse_sfapi_key(key_str)
50-
# update Superfacility API info
51-
update_sfapi_info()
52-
except Exception as e:
53-
title = "Unable to initialize the Superfacility API connection"
54-
msg = f"Error occurred when initializing the Superfacility API connection: {e}"
55-
add_error(title, msg)
56-
print(msg)
57-
58-
5938
def update_sfapi_info():
6039
print("Updating Superfacility API info...")
6140
try:

0 commit comments

Comments
 (0)