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

add argument for inactive_since to specify other timedeltas #5104

Merged

Conversation

moschlar
Copy link
Contributor

@moschlar moschlar commented Oct 5, 2023

Following up on #5076 (comment), #5095 and #5093

I added an argument to configure the inactivity period after which users should be considered for deletion.

(The advanced timedelta argument parsing was more of a fun exercise than really necessary 😉)

(Also, I'd like to politely ask you to add the hacktoberfest-accepted label to this PR if possible)

Otherwise, I get:

    Traceback (most recent call last):
      File "/tmp/datahub/scripts/./delete-unused-users.py", line 116, in <module>
        argparser.add_argument(
      File "/usr/lib/python3.11/argparse.py", line 1480, in add_argument
        return self._add_action(action)
               ^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/argparse.py", line 1862, in _add_action
        self._optionals._add_action(action)
      File "/usr/lib/python3.11/argparse.py", line 1682, in _add_action
        action = super(_ArgumentGroup, self)._add_action(action)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/argparse.py", line 1494, in _add_action
        self._check_conflict(action)
      File "/usr/lib/python3.11/argparse.py", line 1631, in _check_conflict
        conflict_handler(action, confl_optionals)
      File "/usr/lib/python3.11/argparse.py", line 1640, in _handle_conflict_error
        raise ArgumentError(action, message % conflict_string)
    argparse.ArgumentError: argument -h/--hub_url: conflicting option string: -h
@shaneknapp
Copy link
Contributor

thanks for the PR! i tested this locally and it behaves as expected. :)

@shaneknapp shaneknapp merged commit 01b6217 into berkeley-dsep-infra:staging Oct 6, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants