terminated leases can be renamed using update lease api

Bug #1794508 reported by Neha Alhat on 2018-09-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Undecided
Asmita Singh

Bug Description

Bug Description:
================

After the lease ends, it’s status is marked as 'TERMINATED' but you can
still rename the lease using update API.

If user tries to update a lease which is in ‘TERMINATED’ status, it should
return Conflict error as there is no point in renaming a lease.

Steps to reproduce:
===================

Step 1: create a lease(instance reservation)

$ blazar lease-create --reservation resource_type=virtual:instance,vcpus=1,memory_mb=1024,disk_gb=20,amount=1,affinity=False --start-date "2018-09-26 09:50" --end-date "2018-09-26 10:00" lease-1

$ blazar lease-list
+--------------------------------------+---------+----------------------------+----------------------------+
| id | name | start_date | end_date |
+--------------------------------------+---------+----------------------------+----------------------------+
| ba2da1d2-f149-4e0c-b636-0d435c953a7f | lease-1 | 2018-09-26T09:50:00.000000 | 2018-09-26T10:00:00.000000 |
+--------------------------------------+---------+----------------------------+----------------------------+

Step 2: rename a lease after lease end

$ blazar lease-update lease-1 --name lease-2
Updated lease: lease-1

$ blazar lease-list
+--------------------------------------+---------+----------------------------+----------------------------+
| id | name | start_date | end_date |
+--------------------------------------+---------+----------------------------+----------------------------+
| ba2da1d2-f149-4e0c-b636-0d435c953a7f | lease-2 | 2018-09-26T09:50:00.000000 | 2018-09-26T10:00:00.000000 |
+--------------------------------------+---------+----------------------------+----------------------------+

Changed in blazar:
assignee: nobody → Asmita Singh (asmita2018)
status: New → In Progress
Pierre Riteau (priteau) wrote :

This could be a feature rather than a bug: imagine a user named their lease badly, and later they want to rename it to reflect what it was used for?

Changed in blazar:
status: In Progress → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers