app: get_local_name set/from self attribute
This commit is contained in:
parent
40d9696b90
commit
8a27c1919f
@ -153,6 +153,8 @@ class QubesBase(qubesadmin.base.PropertyHolder):
|
|||||||
log = None
|
log = None
|
||||||
#: do not check for object (VM, label etc) existence before really needed
|
#: do not check for object (VM, label etc) existence before really needed
|
||||||
blind_mode = False
|
blind_mode = False
|
||||||
|
#: local name
|
||||||
|
local_name = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(QubesBase, self).__init__(self, 'admin.property.', 'dom0')
|
super(QubesBase, self).__init__(self, 'admin.property.', 'dom0')
|
||||||
@ -226,10 +228,12 @@ class QubesBase(qubesadmin.base.PropertyHolder):
|
|||||||
""" Remove a storage pool """
|
""" Remove a storage pool """
|
||||||
self.qubesd_call('dom0', 'admin.pool.Remove', name, None)
|
self.qubesd_call('dom0', 'admin.pool.Remove', name, None)
|
||||||
|
|
||||||
@staticmethod
|
def get_local_name(self):
|
||||||
def get_local_name():
|
|
||||||
""" Get localhost name """
|
""" Get localhost name """
|
||||||
return os.uname()[1]
|
if not self.local_name:
|
||||||
|
self.local_name = os.uname()[1]
|
||||||
|
|
||||||
|
return self.local_name
|
||||||
|
|
||||||
def get_label(self, label):
|
def get_label(self, label):
|
||||||
"""Get label as identified by index or name
|
"""Get label as identified by index or name
|
||||||
|
Loading…
Reference in New Issue
Block a user