diff --git a/neat/common.py b/neat/common.py index ea44908..f50aaf7 100644 --- a/neat/common.py +++ b/neat/common.py @@ -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. diff --git a/tests/test_common.py b/tests/test_common.py index 5d70b80..e1d46ae 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -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: