"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/drivers/dell_emc/powerstore/utils.py" between
cinder-17.0.1.tar.gz and cinder-17.1.0.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Victoria" series (latest release).

utils.py  (cinder-17.0.1):utils.py  (cinder-17.1.0)
skipping to change at line 26 skipping to change at line 26
"""Utilities for Dell EMC PowerStore Cinder driver.""" """Utilities for Dell EMC PowerStore Cinder driver."""
import re import re
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import units from oslo_utils import units
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _
from cinder.objects import fields from cinder.objects import fields
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CHAP_DEFAULT_USERNAME = "PowerStore_iSCSI_CHAP_Username"
CHAP_DEFAULT_SECRET_LENGTH = 60
def bytes_to_gib(size_in_bytes): def bytes_to_gib(size_in_bytes):
"""Convert size in bytes to GiB. """Convert size in bytes to GiB.
:param size_in_bytes: size in bytes :param size_in_bytes: size in bytes
:return: size in GiB :return: size in GiB
""" """
return size_in_bytes // units.Gi return size_in_bytes // units.Gi
skipping to change at line 128 skipping to change at line 131
if not volume_attachment: if not volume_attachment:
return False return False
attachments = [ attachments = [
attachment for attachment in volume_attachment attachment for attachment in volume_attachment
if (attachment.attach_status == fields.VolumeAttachStatus.ATTACHED and if (attachment.attach_status == fields.VolumeAttachStatus.ATTACHED and
attachment.attached_host == host_name) attachment.attached_host == host_name)
] ]
return len(attachments) > 1 return len(attachments) > 1
def get_chap_credentials():
"""Generate CHAP credentials.
:return: CHAP username and secret
"""
return {
"chap_single_username": CHAP_DEFAULT_USERNAME,
"chap_single_password": volume_utils.generate_password(
CHAP_DEFAULT_SECRET_LENGTH
)
}
 End of changes. 3 change blocks. 
0 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)