From ac7ea86668b6dfcd4065ae38aba3ebfe83a8a539 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 17 Mar 2020 14:49:49 +0100 Subject: [PATCH] rename opennebula commands --- .../commands/{synchost.py => opennebula-synchosts.py} | 10 +++++----- .../commands/{syncvm.py => opennebula-syncvms.py} | 0 ...e-one-vm-to-regular.py => opennebula-to-uncloud.py} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename uncloud/opennebula/management/commands/{synchost.py => opennebula-synchosts.py} (90%) rename uncloud/opennebula/management/commands/{syncvm.py => opennebula-syncvms.py} (100%) rename uncloud/opennebula/management/commands/{migrate-one-vm-to-regular.py => opennebula-to-uncloud.py} (98%) diff --git a/uncloud/opennebula/management/commands/synchost.py b/uncloud/opennebula/management/commands/opennebula-synchosts.py similarity index 90% rename from uncloud/opennebula/management/commands/synchost.py rename to uncloud/opennebula/management/commands/opennebula-synchosts.py index 6e4ea0f..29f9ac1 100644 --- a/uncloud/opennebula/management/commands/synchost.py +++ b/uncloud/opennebula/management/commands/opennebula-synchosts.py @@ -57,17 +57,17 @@ class Command(BaseCommand): usable_ram_in_kb = int(host_share.get('TOTAL_MEM', 0)) usable_ram_in_gb = int(usable_ram_in_kb / 2 ** 20) - vms = host.get('VMS', {}) or {} - vms = vms.get('ID', []) or [] - vms = ','.join(vms) + # vms cannot be created like this -- Nico, 2020-03-17 + # vms = host.get('VMS', {}) or {} + # vms = vms.get('ID', []) or [] + # vms = ','.join(vms) VMHost.objects.update_or_create( hostname=host_name, defaults={ 'usable_cores': usable_cores, 'usable_ram_in_gb': usable_ram_in_gb, - 'status': status, - 'vms': vms + 'status': status } ) else: diff --git a/uncloud/opennebula/management/commands/syncvm.py b/uncloud/opennebula/management/commands/opennebula-syncvms.py similarity index 100% rename from uncloud/opennebula/management/commands/syncvm.py rename to uncloud/opennebula/management/commands/opennebula-syncvms.py diff --git a/uncloud/opennebula/management/commands/migrate-one-vm-to-regular.py b/uncloud/opennebula/management/commands/opennebula-to-uncloud.py similarity index 98% rename from uncloud/opennebula/management/commands/migrate-one-vm-to-regular.py rename to uncloud/opennebula/management/commands/opennebula-to-uncloud.py index 68cf1f2..2f91f83 100644 --- a/uncloud/opennebula/management/commands/migrate-one-vm-to-regular.py +++ b/uncloud/opennebula/management/commands/opennebula-to-uncloud.py @@ -83,7 +83,7 @@ class Command(BaseCommand): def handle(self, *args, **options): for one_vm in VMModel.objects.all(): # Host on which the VM is currently residing - host = VMHost.objects.filter(vms__icontains=one_vm.vmid).first() + #host = VMHost.objects.filter(vms__icontains=one_vm.vmid).first() # VCPU, RAM, Owner, Status # TODO: Set actual status instead of hard coded 'active'