Added build_local_host_path
This commit is contained in:
parent
16e26b6580
commit
e0ce26445e
@ -82,6 +82,19 @@ def build_local_vm_path(local_data_directory):
|
||||
return os.path.join(local_data_directory, 'vms')
|
||||
|
||||
|
||||
@contract
|
||||
def build_local_host_path(local_data_directory):
|
||||
""" Build the path to the local host data file.
|
||||
|
||||
:param local_data_directory: The base local data path.
|
||||
:type local_data_directory: str
|
||||
|
||||
:return: The path to the local host data file.
|
||||
:rtype: str
|
||||
"""
|
||||
return os.path.join(local_data_directory, 'host')
|
||||
|
||||
|
||||
@contract
|
||||
def physical_cpu_count(vir_connection):
|
||||
""" Get the number of physical CPUs using libvirt.
|
||||
|
@ -42,12 +42,18 @@ class Common(TestCase):
|
||||
0,
|
||||
iterations) == state
|
||||
|
||||
@qc
|
||||
@qc(10)
|
||||
def build_local_vm_path(
|
||||
x=str_(of='abc123_-/')
|
||||
):
|
||||
assert common.build_local_vm_path(x) == os.path.join(x, 'vms')
|
||||
|
||||
@qc(10)
|
||||
def build_local_host_path(
|
||||
x=str_(of='abc123_-/')
|
||||
):
|
||||
assert common.build_local_host_path(x) == os.path.join(x, 'host')
|
||||
|
||||
@qc(10)
|
||||
def physical_cpu_count(x=int_(min=0, max=8)):
|
||||
with MockTransaction:
|
||||
|
Loading…
x
Reference in New Issue
Block a user