Best Python code snippet using lisa_python
platform_.py
Source:platform_.py
...1876 assert properties.size, f"fail to get blob size of {blob_url}"1877 # Azure requires only megabyte alignment of vhds, round size up1878 # for cases where the size is megabyte aligned1879 return math.ceil(properties.size / 1024 / 1024 / 1024)1880 def _get_sig_info(1881 self, shared_image: SharedImageGallerySchema1882 ) -> GalleryImageVersion:1883 compute_client = get_compute_client(self)1884 return compute_client.gallery_image_versions.get(1885 resource_group_name=shared_image.resource_group_name,1886 gallery_name=shared_image.image_gallery,1887 gallery_image_name=shared_image.image_definition,1888 gallery_image_version_name=shared_image.image_version,1889 expand="ReplicationStatus",1890 )1891 def _get_sig_os_disk_size(self, shared_image: SharedImageGallerySchema) -> int:1892 found_image = self._get_sig_info(shared_image)1893 assert found_image.storage_profile.os_disk_image.size_in_gb1894 return int(found_image.storage_profile.os_disk_image.size_in_gb)1895 def _get_normalized_vm_sizes(1896 self, name: str, location: str, log: Logger1897 ) -> List[str]:1898 split_vm_sizes: List[str] = [x.strip() for x in name.split(",")]1899 for index, vm_size in enumerate(split_vm_sizes):1900 split_vm_sizes[index] = self._get_normalized_vm_size(vm_size, location, log)1901 return [x for x in split_vm_sizes if x]1902 def _get_normalized_vm_size(self, name: str, location: str, log: Logger) -> str:1903 # find predefined vm size on all available's.1904 location_info: AzureLocation = self.get_location_info(location, log)1905 matched_score: float = 01906 matched_name: str = ""...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!