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

QUADS 2.0.0 timedate / stacktrace on converting strptime for passing --date to move-hosts #497

Closed
sadsfae opened this issue Jun 19, 2024 · 2 comments

Comments

@sadsfae
Copy link
Member

sadsfae commented Jun 19, 2024

We're not able to get valid returns for `quads --move-hosts --dry-run --date "YYYY-MM-DD" like we can in 1.1 series:

2.0.0

[root@quads2-stage quads]# quads --move-hosts --dry-run --date "2024-06-19 12:02"
Check the flask server logs

1.1.8

(root@quads) - (12:48) - (~)
-=>>quads-cli  --move-hosts --dry-run --date "2024-06-19 12:02"
Nothing to do.

Logs:

Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:   File "/usr/lib/python3.12/site-packages/quads/server/blueprints/moves.py", line 26, in get_moves
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]: _date =  datetime.strptime(_params.get("date"), "%Y-%m-%dT%H:%M")
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:   File "/usr/lib64/python3.12/_strptime.py", line 554, in _strptime_datetime
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:     tt, fraction, gmtoff_fraction = _strptime(data_string, format)
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:                                     ^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:   File "/usr/lib64/python3.12/_strptime.py", line 336, in _strptime
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]:     raise ValueError("unconverted data remains: %s" %
Jun 19 11:44:49 quads2-stage.example.com gunicorn[136513]: ValueError: unconverted data remains: :00
@sadsfae sadsfae added this to the 2.0 Series - Bowie milestone Jun 19, 2024
@sadsfae sadsfae self-assigned this Jun 19, 2024
@sadsfae sadsfae changed the title QUADS 2.0.0 timedate / stacktrace on converting strptime for passing --date to M&R QUADS 2.0.0 timedate / stacktrace on converting strptime for passing --date to move-hosts Jun 19, 2024
@sadsfae
Copy link
Member Author

sadsfae commented Jun 19, 2024

Similar command with similar stack trace:

[root@quads2-stage quads]# quads --move-hosts --dry-run --date "2024-06-19T14:02"
Traceback (most recent call last):
  File "/usr/bin/quads", line 33, in <module>
    sys.exit(load_entry_point('quads==2.0', 'console_scripts', 'quads')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/quads/cli/main.py", line 64, in main
    _exit_code = qcli.run(
                 ^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/quads/cli/cli.py", line 64, in run
    exit_code = action_meth()
                ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/quads/cli/cli.py", line 1504, in action_movehosts
    date = datetime.strptime(self.cli_args.get("datearg"), "%Y-%m-%d %H:%M").isoformat()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/_strptime.py", line 554, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/_strptime.py", line 333, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2024-06-19T14:02' does not match format '%Y-%m-%d %H:%M'

sadsfae pushed a commit that referenced this issue Jun 20, 2024
closes: #497
Change-Id: I77f1df28650d7b435cd16e5c15887cdaa7e033eb
@sadsfae
Copy link
Member Author

sadsfae commented Jun 20, 2024

This is resolved in ab04089

@sadsfae sadsfae closed this as completed Jun 20, 2024
@github-project-automation github-project-automation bot moved this from To do to Completed in QUADS 2.0 Release Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Completed
Development

No branches or pull requests

1 participant