Skip to content

Commit

Permalink
Merge pull request #883 from globocom/dev
Browse files Browse the repository at this point in the history
Dev > Master
  • Loading branch information
Erkmann committed May 8, 2023
2 parents 384252f + 614d68f commit 2224e83
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbaas/drivers/replication_topologies/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ def get_auto_upgrade_database_vm_offering(self):
'workflow.steps.util.infra.OfferingAutoUpgrade',
'workflow.steps.util.host_provider.AllocateIPTemporaryInstance',
'workflow.steps.util.host_provider.CreateVirtualMachineTemporaryInstance',
# 'workflow.steps.util.dns.CreateDNS',
# 'workflow.steps.util.dns.CheckIsReady',
'workflow.steps.util.dns.CreateDNSTemporaryInstance',
'workflow.steps.util.dns.CheckIsReadyTemporaryInstance',
'workflow.steps.util.vm.WaitingBeReadyTemporaryInstance',
'workflow.steps.util.vm.UpdateOSDescriptionTemporaryInstance',
)}, {
Expand Down Expand Up @@ -1006,7 +1006,7 @@ def get_auto_upgrade_database_vm_offering(self):
'workflow.steps.util.volume_provider.DetachDataVolumeTemporaryInstance',
'workflow.steps.util.volume_provider.DestroyVolumeTemporaryInstance',

# 'workflow.steps.util.dns.DestroyDNSTemporaryInstance',
'workflow.steps.util.dns.DestroyDNSTemporaryInstance',
'workflow.steps.util.host_provider.DestroyVirtualMachineTemporaryInstance',
'workflow.steps.util.host_provider.DestroyIPTemporaryInstance',
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<h3 class="panel-title">Custom Parameters</h3>
{% if show_auto_configure_btn %}
<a href="{% url 'auto_configure_db_params_btn' database.id %}" target="_blank" class="btn btn-primary">AutoConfigure DB Params</a>
<em>* Atualiza somente o max_connections (MySQL) e não gera downtime!</em>
{% endif %}
</div>

Expand Down
4 changes: 4 additions & 0 deletions dbaas/maintenance/task_auto_upgrade_vm_offering.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def create_maintenance(database, task, resize_target, retry_from):


def task_auto_upgrade_vm_offering(database, task, retry_from=None, resize_target=None):
auto_upgrade_vm = None
try:
infra = database.infra
driver = infra.get_driver()
Expand Down Expand Up @@ -113,6 +114,9 @@ def task_auto_upgrade_vm_offering(database, task, retry_from=None, resize_target
'Please check error message and do retry'
)
except Exception as erro:
if auto_upgrade_vm is not None:
auto_upgrade_vm.set_error()

task.set_status_error('Error: {erro}.\n'
'To create task task_auto_upgrade_vm!\n'
'Please check error message and start new task.'.format(erro=erro))
Expand Down
32 changes: 32 additions & 0 deletions dbaas/workflow/steps/util/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,26 @@ def undo(self):
)


class CreateDNSTemporaryInstance(CreateDNS):

def __unicode__(self):
return "Destroying DNS..."

@property
def is_valid(self):
return self.instance.temporary

def do(self):
if not self.is_valid:
return

return super(CreateDNSTemporaryInstance, self).do()


class DestroyDNSTemporaryInstance(CreateDNS):



@property
def is_valid(self):
return self.instance.temporary
Expand Down Expand Up @@ -420,6 +438,20 @@ def do(self):
for instance in self.instance.hostname.instances.all():
self._check_dns_for(instance.dns, self.host.address)


class CheckIsReadyTemporaryInstance(CheckIsReady):

@property
def is_valid(self):
return self.instance.temporary

def do(self):
if not self.is_valid:
return

return super(CheckIsReadyTemporaryInstance, self).do()


'''
class CheckVipIsReady(CheckIsReady):
Expand Down

0 comments on commit 2224e83

Please sign in to comment.