Skip to content

Commit

Permalink
Merge pull request arenadata#1 from arenadata/adcm-992
Browse files Browse the repository at this point in the history
ADCM-992 on load new bundle search license hash in all bundles, despite the name
  • Loading branch information
acmnu authored Nov 27, 2019
2 parents 15d6197 + d37181f commit 6bccc47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions cm/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,10 @@ def copy_stage_config(stage_config, prototype):


def check_license(bundle):
b = Bundle.objects.filter(name=bundle.name).order_by('version_order').last()
b = Bundle.objects.filter(license_hash=bundle.license_hash, license='accepted')
if not b:
return False
if b.license != 'accepted':
return False
if b.license_hash == bundle.license_hash:
return True
return False
return True


def copy_stage(bundle_hash, bundle_proto):
Expand Down
4 changes: 3 additions & 1 deletion cm/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
class TestUpgradeVersion(TestCase):

def cook_cluster(self):
return Cluster(prototype=Prototype(type="cluster", name="ADH"), issue='{}')
b = Bundle(name="ADH", version="1.0")
proto = Prototype(type="cluster", name="ADH", bundle=b)
return Cluster(prototype=proto, issue='{}')

def cook_upgrade(self):
return Upgrade(
Expand Down

0 comments on commit 6bccc47

Please sign in to comment.