docs: def get_os_version_package(pkg, fatal=True):
      '''Derive OpenStack version number from an installed package.'''
      codename = get_os_codename_package(pkg, fatal=fatal)
  
      if not codename:
          return None
  
      if 'swift' in pkg:
          vers_map = SWIFT_CODENAMES
          for cname, version in six.iteritems(vers_map):
              if cname == codename:
                  return version[-1]
      else:
          vers_map = OPENSTACK_CODENAMES
          for version, cname in six.iteritems(vers_map):
              if cname == codename:
                  return version