diff options
| author | Ariel-Berkowicz <arielmb@bu.edu> | 2022-12-05 19:30:05 -0500 |
|---|---|---|
| committer | Ariel-Berkowicz <arielmb@bu.edu> | 2022-12-12 18:58:16 -0500 |
| commit | 992cfdfb57c359f709a0ceb67502f5bd66b90e5a (patch) | |
| tree | 9f3f387f5b517fd60a845113f2e17d02a709abe3 /openstackclient/tests/unit/compute/v2/fakes.py | |
| parent | 29129a7715feb750b7738a5884f9d2f49491a511 (diff) | |
| download | python-openstackclient-992cfdfb57c359f709a0ceb67502f5bd66b90e5a.tar.gz | |
Migrate hypervisor stats commands to SDK
Change-Id: I43b2071f5108c28f6881c8e99d4b06e87c83ddfa
Diffstat (limited to 'openstackclient/tests/unit/compute/v2/fakes.py')
| -rw-r--r-- | openstackclient/tests/unit/compute/v2/fakes.py | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/openstackclient/tests/unit/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py index 7d8c29ad..6ebdfc64 100644 --- a/openstackclient/tests/unit/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -341,67 +341,6 @@ class FakeExtension(object): return extension -class FakeHypervisorStats(object): - """Fake one or more hypervisor stats.""" - - @staticmethod - def create_one_hypervisor_stats(attrs=None): - """Create a fake hypervisor stats. - - :param dict attrs: - A dictionary with all attributes - :return: - A FakeResource object, with count, current_workload, and so on - """ - attrs = attrs or {} - - # Set default attributes. - stats_info = { - 'count': 2, - 'current_workload': 0, - 'disk_available_least': 50, - 'free_disk_gb': 100, - 'free_ram_mb': 23000, - 'local_gb': 100, - 'local_gb_used': 0, - 'memory_mb': 23800, - 'memory_mb_used': 1400, - 'running_vms': 3, - 'vcpus': 8, - 'vcpus_used': 3, - } - - # Overwrite default attributes. - stats_info.update(attrs) - - # Set default method. - hypervisor_stats_method = {'to_dict': stats_info} - - hypervisor_stats = fakes.FakeResource( - info=copy.deepcopy(stats_info), - methods=copy.deepcopy(hypervisor_stats_method), - loaded=True) - return hypervisor_stats - - @staticmethod - def create_hypervisors_stats(attrs=None, count=2): - """Create multiple fake hypervisors stats. - - :param dict attrs: - A dictionary with all attributes - :param int count: - The number of hypervisors to fake - :return: - A list of FakeResource objects faking the hypervisors - """ - hypervisors = [] - for i in range(0, count): - hypervisors.append( - FakeHypervisorStats.create_one_hypervisor_stats(attrs)) - - return hypervisors - - class FakeSecurityGroup(object): """Fake one or more security groups.""" |
