How to use the productmd.common.create_release_id function in productmd

To help you get started, we’ve selected a few productmd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github product-definition-center / product-definition-center / pdc / apps / release / lib.py View on Github external
short=release.short.lower(),
        version=release.version.split('.')[0]
    )
    try:
        integrated_release, _ = _logged_get_or_create(
            request, models.Release,
            name=release.name,
            short=release.short.lower(),
            release_type=orig_release.release_type,
            version=release.version,
            base_product=integrated_base_product,
            integrated_with=orig_release,
            product_version=integrated_product_version
        )
    except ValidationError:
        release_id = create_release_id(
            release.short.lower(),
            release.version,
            orig_release.release_type.short,
            integrated_base_product.short,
            integrated_base_product.version,
            integrated_base_product.release_type.short,
        )
        msg = ('Failed to create release {} for integrated layered product.' +
               ' A conflicting release already exists.' +
               ' There is likely a version mismatch between the imported' +
               ' release and its layered integrated product in the composeinfo.')
        raise ValidationError(msg.format(release_id))
    return integrated_release
github product-definition-center / product-definition-center / pdc / apps / release / models.py View on Github external
def get_release_id(self):
        bp_dict = {}
        if self.base_product:
            bp_dict = {
                "bp_short": self.base_product.short.lower(),
                "bp_version": self.base_product.version,
                "bp_type": self.base_product.release_type.short,
            }
        return create_release_id(self.short.lower(), self.version, self.release_type.short, **bp_dict)
github product-definition-center / product-definition-center / pdc / apps / release / models.py View on Github external
def get_base_product_id(self):
        return create_release_id(self.short.lower(), self.version, self.release_type.short)