Skip to content

Commit

Permalink
kfish: check image is inserted as part of iso status
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Nov 7, 2024
1 parent 71d879a commit 24e9a79
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ailib/kfish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ def get_iso_status(self):
print(f"Getting {iso_url}")
request = Request(iso_url, headers=self.headers)
response = json.loads(urlopen(request).read())
ret_data = f"{response['Image']}"
iso = f"{response['Image']}"
inserted = f"{response['Inserted']}"
if self.debug:
print(f"ISO status is {ret_data}")
return ret_data
print(f"ISO status is Image: {iso} Inserted: {inserted}")
return iso, inserted

def get_iso_eject_url(self):
iso_url = self.get_iso_url()
Expand Down Expand Up @@ -271,8 +272,8 @@ def reset(self):

def set_iso(self, iso_url):
result = None
current_iso = self.get_iso_status()
if current_iso == iso_url:
current_iso, inserted = self.get_iso_status()
if current_iso == iso_url and inserted:
print(f"Iso {iso_url} already set")
else:
if current_iso != '':
Expand Down

0 comments on commit 24e9a79

Please sign in to comment.