Skip to content

Commit

Permalink
Fix bug causing credential file to be overwritten. Code works now.
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Oct 20, 2023
1 parent 46e3fbb commit 2cf3304
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions client/quantum_serverless/core/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def __init__(self, token: Optional[str] = None):
Args:
token: IBM quantum token
"""
self._default_account_name_ibm_quantum = "default-ibm-quantum-serverless"
self._default_account_name_ibm_quantum = "default-ibm-quantum"
self._default_account_config_json_file = os.path.join(
os.path.expanduser("~"), ".qiskit", "qiskit-ibm.json"
)
Expand Down Expand Up @@ -536,12 +536,13 @@ def save_account(

@staticmethod
def _ensure_file_exists(filename: str) -> None:
# Create parent directories
os.makedirs(os.path.dirname(filename), exist_ok=True)
if not os.path.isfile(filename):
# Create parent directories
os.makedirs(os.path.dirname(filename), exist_ok=True)

# Initialize file
with open(filename, mode="w", encoding="utf-8") as json_file:
json_file.write("{}")
# Initialize file
with open(filename, mode="w", encoding="utf-8") as json_file:
json_file.write("{}")

def get_compute_resources(self) -> List[ComputeResource]:
raise NotImplementedError("GatewayProvider does not support resources api yet.")
Expand Down

0 comments on commit 2cf3304

Please sign in to comment.