Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions esileapclient/osc/v1/offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.

import datetime
import logging
import json

Expand All @@ -20,6 +21,7 @@
from esileapclient.v1.offer import Offer as OFFER_RESOURCE
from esileapclient.common import utils

END_OF_TIME = '9999-12-31T00:00:00'
LOG = logging.getLogger(__name__)


Expand Down Expand Up @@ -161,6 +163,16 @@ def get_parser(self, prog_name):
"Can be specified multiple times. "
f"Supported operators are: {', '.join(utils.OPS.keys())}",
metavar='"key>=value"')
parser.add_argument(
'--now',
action='store_const',
dest='availability_range',
const=[
datetime.datetime.now().isoformat(timespec='seconds'),
END_OF_TIME
],
help='Only list offers that have availability right now',
)

return parser

Expand Down
Loading