'Obtain backend volume stats and capabilities list.
This stores a dictionary which is consisted of two parts.
First part includes static backend capabilities which are
obtained by get_volume_stats(). Second part is properties,
which includes parameters correspond to extra specs.
This properties part is consisted of cinder standard
capabilities and vendor unique properties.
Using this capabilities list, operator can manage/configure
backend using key/value from capabilities without specific
knowledge of backend.'

def init_capabilities(self):

    stats = self.get_volume_stats(True)
    if stats:
        self.capabilities = stats.copy()
    self.capabilities['properties'] = self._init_standard_capabilities()
    (vendor_prop, vendor_name) = self._init_vendor_properties()
    if (vendor_name and vendor_prop):
        updated_vendor_prop = {}
        old_name = None
        if (':' in vendor_name):
            old_name = vendor_name
            vendor_name = vendor_name.replace(':', '_')
            LOG.warning('The    colon    in    vendor    name    was    replaced    by    underscore.    Updated    vendor    name    is    %(name)s".', {'name': vendor_name})
        for key in vendor_prop:
            if (old_name and key.startswith((old_name + ':'))):
                new_key = key.replace(old_name, vendor_name, 1)
                updated_vendor_prop[new_key] = vendor_prop[key]
                continue
            if (not key.startswith((vendor_name + ':'))):
                LOG.warning('Vendor    unique    property    "%(property)s"    must    start    with    vendor    prefix    with    colon    "%(prefix)s".    The    property    was    not    registered    on    capabilities    list.', {'prefix': (vendor_name + ':'), 'property': key})
                continue
            updated_vendor_prop[key] = vendor_prop[key]
        self.capabilities['vendor_prefix'] = vendor_name
        self.capabilities['properties'].update(updated_vendor_prop)
    LOG.debug('Initialized    capabilities    list:    %s.', self.capabilities)
