diff --git a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py index 1b122a91b85da11e7c974ce4aeb2fa88fd86669b..f327b9bb689bf9c622289872d7ffb9688182a768 100644 --- a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.8 on 2020-09-02 16:52 +# Generated by Django 3.0.8 on 2020-09-09 09:23 from django.conf import settings import django.contrib.postgres.fields @@ -52,6 +52,7 @@ class Migration(migrations.Migration): ('name', models.CharField(help_text='Human-readable name of this object.', max_length=128)), ('description', models.CharField(help_text='A longer description of this object.', max_length=255)), ('location', models.CharField(help_text='Human-readable location of the cluster.', max_length=128)), + ('archive_site', models.BooleanField(help_text='TRUE if this cluster is an archive site, FALSE if not (f.e. a local cluster, or user-owned cluster).')), ], options={ 'abstract': False, diff --git a/SAS/TMSS/src/tmss/tmssapp/models/scheduling.py b/SAS/TMSS/src/tmss/tmssapp/models/scheduling.py index 9981cc0c58324cd0e5def205ac3decf9715e9655..d658ff43c17c43157e6e149c2a24bfc8024393da 100644 --- a/SAS/TMSS/src/tmss/tmssapp/models/scheduling.py +++ b/SAS/TMSS/src/tmss/tmssapp/models/scheduling.py @@ -320,6 +320,7 @@ class Filesystem(NamedCommon): class Cluster(NamedCommon): location = CharField(max_length=128, help_text='Human-readable location of the cluster.') + archive_site = BooleanField(help_text='TRUE if this cluster is an archive site, FALSE if not (f.e. a local cluster, or user-owned cluster).') class DataproductArchiveInfo(BasicCommon): diff --git a/SAS/TMSS/src/tmss/tmssapp/populate.py b/SAS/TMSS/src/tmss/tmssapp/populate.py index 67d8048759c79fc06e7d748627d57463e8e41439..9331a7264e4d97839d16ae9d989e01cfddf54de4 100644 --- a/SAS/TMSS/src/tmss/tmssapp/populate.py +++ b/SAS/TMSS/src/tmss/tmssapp/populate.py @@ -179,7 +179,7 @@ def populate_resources(apps, schema_editor): def populate_misc(apps, schema_editor): - cluster = Cluster.objects.create(name="CEP4", location="CIT") + cluster = Cluster.objects.create(name="CEP4", location="CIT", archive_site=False) fs = Filesystem.objects.create(name="LustreFS", cluster=cluster, capacity=3.6e15) diff --git a/SAS/TMSS/test/tmss_test_data_django_models.py b/SAS/TMSS/test/tmss_test_data_django_models.py index f3c6d8664c49fb4b09e05324c36982cdd0d23d8e..dd47feef976db59124e5a732d65038a5074543ab 100644 --- a/SAS/TMSS/test/tmss_test_data_django_models.py +++ b/SAS/TMSS/test/tmss_test_data_django_models.py @@ -369,7 +369,7 @@ def Subtask_test_data(task_blueprint: models.TaskBlueprint=None, subtask_templat stop_time = datetime.utcnow() + timedelta(minutes=10) if cluster is None: - cluster = models.Cluster.objects.create(name="dummy cluster", location="downstairs", tags=[]) + cluster = models.Cluster.objects.create(name="dummy cluster", location="downstairs", archive_site=True, tags=[]) if state is None: state = models.SubtaskState.objects.get(value='defining') @@ -445,6 +445,7 @@ def Filesystem_test_data(directory="/") -> dict: def Cluster_test_data(name="default cluster") -> dict: return {"name": name, "location": "upstairs", + "archive_site": True, "tags": ['tmss', 'testing']} def DataproductArchiveInfo_test_data() -> dict: diff --git a/SAS/TMSS/test/tmss_test_data_rest.py b/SAS/TMSS/test/tmss_test_data_rest.py index 12efcc9bb893093bbdbb817ce69409d0033f8692..fb60b94907ac79e5f2f00696c08c39de6249de38 100644 --- a/SAS/TMSS/test/tmss_test_data_rest.py +++ b/SAS/TMSS/test/tmss_test_data_rest.py @@ -445,6 +445,7 @@ class TMSSRESTTestDataCreator(): return {"name": name if name else "Cluster %s" % uuid.uuid4(), "description": 'My one cluster', "location": "upstairs", + "archive_site": False, "tags": ['tmss', 'testing']} def Subtask(self, cluster_url=None, task_blueprint_url=None, specifications_template_url=None, specifications_doc=None, state:str="defining"):