Provide fake CPUs count and total memory in offline mode

This commit is contained in:
Marek Marczykowski-Górecki 2016-06-16 21:08:44 +02:00
parent 5eea473725
commit 2ff6aa456e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -248,6 +248,8 @@ class QubesHost(object):
def memory_total(self): def memory_total(self):
'''Total memory, in kbytes''' '''Total memory, in kbytes'''
if self.app.vmm.offline_mode:
return 2**64-1
self._fetch() self._fetch()
return self._total_mem return self._total_mem
@ -256,6 +258,9 @@ class QubesHost(object):
def no_cpus(self): def no_cpus(self):
'''Number of CPUs''' '''Number of CPUs'''
if self.app.vmm.offline_mode:
return 42
self._fetch() self._fetch()
return self._no_cpus return self._no_cpus