def parse_sr_info(connection_data, description=''):
    params = {}
    if 'sr_uuid' not in connection_data:
        params = _parse_volume_info(connection_data)
        sr_identity = "%s/%s/%s" % (params['target'], params['port'],
                                    params['targetIQN'])
        # PY2 can only support taking an ascii string to uuid5
        if six.PY2 and isinstance(sr_identity, unicode):
            sr_identity = sr_identity.encode('utf-8')
        sr_uuid = str(uuid.uuid5(SR_NAMESPACE, sr_identity))
    else:
        sr_uuid = connection_data['sr_uuid']
        for k in connection_data.get('introduce_sr_keys', {}):
            params[k] = connection_data[k]

    label = connection_data.pop('name_label',
                                'tempSR-%s' % sr_uuid)
    params['name_description'] = connection_data.get('name_description',
                                                     description)

    return (sr_uuid, label, params)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/volume_utils.py/parse_sr_info/original