Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue - start date is being allowed to be set to a value that is after the end date #507

Closed
QuantumPosix opened this issue Jul 2, 2024 · 3 comments

Comments

@QuantumPosix
Copy link
Contributor

  • QUADS version (rpm -qa | grep quads and/or quads --version): quads-1.1.8-20240130.noarch
  • Python version: Python 3.11.8
  • Operating System: Fedora release 38 (Thirty Eight)

Describe the bug
When creating an new assignment, it allows you to create it with a start date that is after the end date. Implement a check to make sure the start date is before the start date / time .

To Reproduce
Steps to reproduce the behavior:

  1. Schedule assignment with command:

quads-cli --host-list /root/utility/tickets/$ticket --add-schedule --schedule-start "2024-07-30 22:00" --schedule-end "2024-07-14 22:00" --schedule-cloud $cloud

  1. Try to use mod-cloud after its created:
    -=>>quads-cli --mod-schedule --host $host --schedule-id 5 --schedule-start "2024-07-02 11:20 22:00" --schedule-end "2024-07-21 22:00"
    list indices must be integers or slices, not str
    Traceback (most recent call last):
    File "/opt/quads/bin/quads-cli", line 78, in
    exit_code = main(_logger=logger)
    ^^^^^^^^^^^^^^^^^^^^
    File "/opt/quads/bin/quads-cli", line 68, in main
    return qcli.run(
    ^^^^^^^^^
    File "/opt/quads/quads/cli/cli.py", line 78, in run
    return action_meth()
    ^^^^^^^^^^^^^
    File "/opt/quads/quads/cli/cli.py", line 1330, in action_modschedule
    self.logger.info(self.quads.insert_schedule(data)["result"])
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
    TypeError: list indices must be integers or slices, not str

Expected behavior

A warning or error that displays not letting them set a start date if it is after the end date.

@sadsfae
Copy link
Member

sadsfae commented Jul 2, 2024

@QuantumPosix thanks for posting this, we will waterfall roll this into QUADS 2.0 backlog to check if this still happens there.

@QuantumPosix
Copy link
Contributor Author

QuantumPosix commented Jul 2, 2024 via email

@sadsfae
Copy link
Member

sadsfae commented Jul 3, 2024

Thanks for conforming this @QuantumPosix

@sadsfae sadsfae closed this as completed Jul 3, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in QUADS 2.0 Series Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants