Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-390512: Improved xenapi error handling #48

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions XSConsoleData.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ def Update(self):
# NULL or dangling reference
self.data['host']['crash_dump_sr'] = None

convertCPU = lambda cpu: self.session.xenapi.host_cpu.get_record(cpu)
self.data['host']['host_CPUs'] = list(map(convertCPU, self.data['host']['host_CPUs']))
self.UpdateHostCPUs()

def convertPIF(inPIF):
retVal = self.session.xenapi.PIF.get_record(inPIF)
Expand Down Expand Up @@ -360,6 +359,17 @@ def update_SR_reference(inPool, retPool, key):

self.DeriveData()

def UpdateHostCPUs(self):
convertCPU = lambda cpu: self.session.xenapi.host_cpu.get_record(cpu)
hostCPUs = list(map(convertCPU, self.data['host']['host_CPUs']))

self.data['host']['host_CPUs'] = []
for cpu in hostCPUs:
if 'HANDLE_INVALID' in cpu:
XSLogError('xenapi host_cpu: ' + ', '.join(cpu))
else:
self.data['host']['host_CPUs'].append(cpu)

def DeriveData(self):
self.data.update({
'derived' : {
Expand Down
Loading