Sfoglia il codice sorgente

Return vm type RAM in GB

Adresses https://github.com/gvlproject/cloudbridge/issues/115 (except for the GCE provider)
Enis Afgan 8 anni fa
parent
commit
685321ef41

+ 5 - 0
.gitignore

@@ -58,3 +58,8 @@ target/
 
 *.DS_Store
 /venv/
+
+bootstrap.py
+ISB-*
+launch.json
+settings.json

+ 3 - 3
cloudbridge/cloud/interfaces/resources.py

@@ -1768,10 +1768,10 @@ class VMType(CloudResource):
     @abstractproperty
     def ram(self):
         """
-        The amount of RAM (in MB) supported by this VM type.
+        The amount of RAM (in GB) supported by this VM type.
 
-        :rtype: ``int``
-        :return: Total RAM (in MB).
+        :rtype: ``float``
+        :return: Total RAM (in GB).
         """
         pass
 

+ 1 - 1
cloudbridge/cloud/providers/azure/resources.py

@@ -1481,7 +1481,7 @@ class AzureVMType(BaseVMType):
 
     @property
     def ram(self):
-        return self._vm_type.memory_in_mb
+        return int(self._vm_type.memory_in_mb) / 1024
 
     @property
     def size_root_disk(self):

+ 1 - 1
cloudbridge/cloud/providers/openstack/resources.py

@@ -211,7 +211,7 @@ class OpenStackVMType(BaseVMType):
 
     @property
     def ram(self):
-        return self._os_flavor.ram
+        return int(self._os_flavor.ram) / 1024
 
     @property
     def size_root_disk(self):