Add vm.is_networked()

This commit is contained in:
Marek Marczykowski-Górecki 2017-05-19 17:33:12 +02:00
parent 938fc9348f
commit f5e102177c
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -215,6 +215,19 @@ class QubesVM(qubesadmin.base.PropertyHolder):
return self.get_power_state() != 'Halted'
def is_networked(self):
'''Check whether this VM can reach network (firewall notwithstanding).
:returns: :py:obj:`True` if is machine can reach network, \
:py:obj:`False` otherwise.
:rtype: bool
'''
if self.provides_network:
return True
return self.netvm is not None
@property
def volumes(self):
'''VM disk volumes'''