-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from k3nd1k/development
fix: removed problematic call from boot_to()
- Loading branch information
Showing
3 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,3 +112,4 @@ venv.bak/ | |
|
||
# SCP Exports folder (Testing purpose) | ||
tests/exports/ | ||
exports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,7 +269,7 @@ async def get_bios_attribute_registry(self, attribute): | |
data = await self.get_bios_attributes_registry() | ||
attribute_value = await self.get_bios_attribute(attribute) | ||
for entry in data["RegistryEntries"]["Attributes"]: | ||
entries = [low_entry.lower() for low_entry in entry.values() if type(low_entry) == str] | ||
entries = [low_entry.lower() for low_entry in entry.values() if isinstance(low_entry, str)] | ||
if attribute.lower() in entries: | ||
for values in entry.items(): | ||
if values[0] == "CurrentValue": | ||
|
@@ -300,15 +300,15 @@ async def get_bios_attribute(self, attribute): | |
try: | ||
bios_attribute = data["Attributes"][attribute] | ||
return bios_attribute | ||
except KeyError: | ||
except (KeyError, TypeError): | ||
self.logger.warning("Could not retrieve Bios Attributes.") | ||
return None | ||
|
||
async def set_bios_attribute(self, attributes): | ||
data = await self.get_bios_attributes_registry() | ||
accepted = False | ||
for entry in data["RegistryEntries"]["Attributes"]: | ||
entries = [low_entry.lower() for low_entry in entry.values() if type(low_entry) == str] | ||
entries = [low_entry.lower() for low_entry in entry.values() if isinstance(low_entry, str)] | ||
_warnings = [] | ||
_not_found = [] | ||
_remove = [] | ||
|
@@ -1073,7 +1073,6 @@ async def boot_to(self, device): | |
if device_check: | ||
await self.clear_job_queue() | ||
await self.send_one_time_boot(device) | ||
await self.create_bios_config_job(self.bios_uri) | ||
else: | ||
return False | ||
return True | ||
|
@@ -1297,14 +1296,18 @@ async def get_virtual_media_config(self): | |
if self.vendor == "Supermicro": | ||
try: | ||
vm_path = { | ||
"config": data["Oem"].get("Supermicro").get("VirtualMediaConfig").get("@odata.id"), | ||
"config": "", | ||
"count": data["[email protected]"], | ||
"members": [], | ||
} | ||
if data["Oem"].get("Supermicro"): | ||
vm_path.update({"config": data["Oem"].get("Supermicro").get("VirtualMediaConfig").get("@odata.id")}) | ||
else: | ||
vm_path.update({"config": data["Oem"].get("VirtualMediaConfig").get("@odata.id")}) | ||
if vm_path["count"] > 0: | ||
for m in data["Members"]: | ||
vm_path["members"].append(m.get("@odata.id")) | ||
except (ValueError, KeyError): | ||
except (ValueError, KeyError, TypeError): | ||
raise BadfishException("Not able to access virtual media config.") | ||
else: | ||
try: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters