Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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)
def get_base_product_id(self):
return create_release_id(self.short.lower(), self.version, self.release_type.short)