diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2020-07-31 16:44:19 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2020-07-31 16:44:19 +0000 |
commit | 0b714de9fbec893927d843317c1e2deadf4416b8 (patch) | |
tree | 9d6b48250bc621118123b313a98749e03b272194 | |
parent | 924e659f949b9174572223b83cf3fbb15f248b52 (diff) | |
parent | 219d6376a369bf62c78b7b092b605f96997a3599 (diff) |
Merge "Fix Pod detail menu and re-imaging"
-rw-r--r-- | src/api/models.py | 6 | ||||
-rw-r--r-- | src/booking/views.py | 2 | ||||
-rw-r--r-- | src/templates/base/booking/booking_detail.html | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/api/models.py b/src/api/models.py index 89ee6c6..9b9b778 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -868,13 +868,13 @@ class JobFactory(object): """Modify an existing job to reimage the given host.""" job = Job.objects.get(booking=booking) # make hardware task new - hardware_relation = HostHardwareRelation.objects.get(host=host, job=job) - hardware_relation.config.set_image(new_image.lab_id) + hardware_relation = HostHardwareRelation.objects.get(resource_id=host, job=job) + hardware_relation.config.image = new_image.lab_id hardware_relation.config.save() hardware_relation.status = JobStatus.NEW # re-apply networking after host is reset - net_relation = HostNetworkRelation.objects.get(host=host, job=job) + net_relation = HostNetworkRelation.objects.get(resource_id=host, job=job) net_relation.status = JobStatus.NEW # re-apply ssh access after host is reset diff --git a/src/booking/views.py b/src/booking/views.py index 3c95e07..bd57812 100644 --- a/src/booking/views.py +++ b/src/booking/views.py @@ -173,7 +173,7 @@ def booking_modify_image(request, booking_id): if timezone.now() > booking.end: return HttpResponse("unauthorized") new_image = Image.objects.get(id=form.cleaned_data['image_id']) - host = ResourceQuery.get(labid=form.cleaned_data['host_id']) + host = ResourceQuery.get(id=form.cleaned_data['host_id']) host.config.image = new_image host.config.save() JobFactory.reimageHost(new_image, booking, host) diff --git a/src/templates/base/booking/booking_detail.html b/src/templates/base/booking/booking_detail.html index fea2bb6..4b70f69 100644 --- a/src/templates/base/booking/booking_detail.html +++ b/src/templates/base/booking/booking_detail.html @@ -55,13 +55,13 @@ </div> <div class="collapse show" id="pod_panel"> <div class="card-body"> - {% for host in booking.resource.hosts.all %} - <h4>{{host.template.resource.name}}</h4> + {% for host in booking.resource.get_resources %} + <h4>{{host.bundle.template.copy_of.name}}</h4> <div class="overflow-auto"> <table class="table m-0"> <tr> <td>Hostname:</td> - <td>{{host.template.resource.name}}</td> + <td>{{host.name}}</td> </tr> <tr> <td>Machine:</td> @@ -69,12 +69,12 @@ </tr> <tr> <td>Role:</td> - <td>{{host.config.opnfvRole}}</td> + <td>{{host.template.opnfvRole}}</td> </tr> <tr> <td>Image:</td> <td id="host_image_{{host.id}}"> - {{host.config.image}} + {{host.config.Image}} <button class="btn btn-primary ml-4" data-toggle="modal" |