Prolong-for option for lease-update doesn't accept negative values

Bug #1305129 reported by Christian Martinez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Medium
Christian Martinez

Bug Description

Via pythonclient itself we can reduce the leases length, but the climate CLI only allows to prolong the lease.

The idea behind this bug (or bp, I prefer) is to allow the user to put a negative time within the lease-update arguments, so you can reduce the lease length easily and without to much effort

For instance:

climate lease-update --name "new name" --prolong-for "-1h"

should reduce the lease by an hour from the end_date.

Maybe, we should also change some of the doc related to the command, because it will be unclear for the user how to use this new option.

Revision history for this message
Dina Belova (dbelova) wrote :

Here is prolong-for option - https://github.com/stackforge/python-climateclient/blob/master/climateclient/v1/leases.py#L44
You should fit it somewhere here)

Changed in climate:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Dina Belova (dbelova) wrote :

You may even use not --prolong-for, but create some other option, for clear view for the user.

Revision history for this message
Christian Martinez (christian-martinez) wrote :

Thanks! I'll keep that in mind

Dina Belova (dbelova)
Changed in climate:
assignee: nobody → Christian Martinez (christian-martinez)
Revision history for this message
Christian Martinez (christian-martinez) wrote :

This bug could be consider as bp (add new feature) and bug (partially implemented staff, forgotten to be done).
I'll add the functionality to make this work, but after that, we need to create a bp for the "other" option that Dina mentioned in the above comment.

Revision history for this message
Christian Martinez (christian-martinez) wrote :

What about smth like this:

$ climate help lease-update
usage: climate lease-update [-h] [--name NAME] [--prolong-for PROLONG_FOR]
                            [--reduce-by REDUCE_BY]
                            LEASE

positional arguments:
  LEASE ID or name of lease to delete

optional arguments:
  -h, --help show this help message and exit
  --name NAME New name for the lease
  --prolong-for PROLONG_FOR
                        Time to prolong lease for
  --reduce-by REDUCE_BY
                        Time to reduce lease by

The reduce-by option will make the call. Is that makes sense?
What would happen if the user puts the two options at the same time?

Changed in climate:
status: Triaged → Opinion
status: Opinion → In Progress
Revision history for this message
Christian Martinez (christian-martinez) wrote :

I uploaded a patch with this new argument. No need to create a bp (at least for now)

Revision history for this message
Christian Martinez (christian-martinez) wrote :
Changed in climate:
status: In Progress → Fix Committed
Changed in blazar:
milestone: none → 0.1.1
Changed in blazar:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.