def from_label(cls, label, datacenter=None):
        """Retrieve disk image id associated to a label."""
        result = cls.list(datacenter=datacenter)
        image_labels = dict([(image['label'], image['disk_id'])
                             for image in result])

        return image_labels.get(label)
def from_label ( cls , label , datacenter = None ) : result = cls . list ( datacenter = datacenter ) image_labels = dict ( [ ( image [ 'label' ] , image [ 'disk_id' ] ) for image in result ] ) return image_labels . get ( label )
Retrieve disk image id associated to a label.