Ejemplo n.º 1
0
def check_instance_name_update(sender, instance=None, created=False, **kwargs):
    if created:
        return

    old_name = instance._old_values['name']
    if old_name != instance.name:
        from nodeconductor.iaas.tasks.zabbix import zabbix_update_host_visible_name
        zabbix_update_host_visible_name.delay(instance.uuid)
Ejemplo n.º 2
0
def check_project_name_update(sender, instance=None, created=False, **kwargs):
    if created:
        return

    old_name = instance.tracker.previous('name')
    if old_name != instance.name:
        cpms = CloudProjectMembership.objects.filter(
            project__uuid=instance.uuid)
        if cpms.exists():
            from nodeconductor.iaas.tasks.zabbix import zabbix_update_host_visible_name

            for cpm in cpms:
                zabbix_update_host_visible_name.delay(cpm.pk, is_tenant=True)