freeze period in place #45
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.29 on 2026-09-13 15:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cloudmanager', '0002_deployment_data_actual_replica'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='deployment_data',
|
||||
name='do_not_touch_until',
|
||||
field=models.DateField(blank=True, null=True, verbose_name='do_not_touch_until'),
|
||||
),
|
||||
]
|
||||
@@ -55,6 +55,7 @@ class Deployment_Data(models.Model):
|
||||
schedule_day = models.ForeignKey(Schedule_Day_Data,null=True, blank=True, on_delete=models.SET_NULL)
|
||||
replicas = models.IntegerField()
|
||||
actual_replica = models.IntegerField()
|
||||
do_not_touch_until = models.DateField('do_not_touch_until', blank=True, null=True)
|
||||
class Meta:
|
||||
db_table = 'machine'
|
||||
|
||||
|
||||
@@ -89,6 +89,9 @@ def Check_server_supposed_XXX(expected_status,verbose=False):
|
||||
replicas = deployment.replicas
|
||||
display_list.append(replicas)
|
||||
if verbose : print("replicas: "+str(replicas))
|
||||
do_not_touch_until = deployment.do_not_touch_until
|
||||
display_list.append(do_not_touch_until)
|
||||
if verbose : print("do_not_touch_until: "+str(do_not_touch_until))
|
||||
#Adding the whole object as well for future use
|
||||
display_list.append(deployment)
|
||||
deployments_list.append(display_list)
|
||||
@@ -113,6 +116,7 @@ def retrieve_and_apply(verbose=False):
|
||||
#check if the expected replica (server[2]) match the current replica of the deployment (server[3].actual_replica)
|
||||
if server[3].actual_replica == server[2]:
|
||||
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already UP")
|
||||
#if server[3].do_not_touch_until is after now , do something
|
||||
else:
|
||||
echo = "Starting -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
|
||||
output += str(echo)
|
||||
|
||||
Reference in New Issue
Block a user