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

Option to override deprecation date #80

Closed
smarlowucf opened this issue Mar 30, 2022 · 6 comments
Closed

Option to override deprecation date #80

smarlowucf opened this issue Mar 30, 2022 · 6 comments

Comments

@smarlowucf
Copy link
Contributor

An image may need to be deprecated after the fact. For this use case it would be nice to have an option to override the deprecation date so it matches the correct time of deprecation.

@smarlowucf
Copy link
Contributor Author

The format we use is YYYYMMDD so it would be helpful to have an option like --deprecation-date 20220202. This would override the default which is the current date.

@rjschwei
Copy link
Collaborator

rjschwei commented May 9, 2022

Agreed @apozsuse this is low hanging fruit to get you started could you please take a look? Please let me know if you have any questions.

@apozsuse
Copy link
Contributor

apozsuse commented May 9, 2022

Perfect!
I'll come with some questions if I have some.

apozsuse added a commit that referenced this issue May 10, 2022
…g command

This change includes a new parameter (--deprecation-date) in the ec2deprecateimg
script to allow the user to override the default deprecation date (today's date).

[Issue 80](#80)

- As the requested param is optional, in case it's not included the behavior is
the one the script already had (defaulting to the execution date).
- When the parameter provided does not match the expected format (YYYYMMDD), the
script raises and exception, prints the error message and exits(1).

- _README.md_ file has been updated with the updated information.
- man page was updated to include the new param
- _ec2deprecateimg_:
  - The new parameter has been added to the argparse code
  - A new parameter with the deprecation date provided (or empty string if not provided)
  has been added to the initialization of EC2DeprecateImg class
  - As the class initialization can raise an exception (if the provided deprecation-date
  is not correct) the initialization has been included in a try-catch.
- _lib/ec2imgutils/ec2deprecateim.py_:
  - _set_deletion_date and _set_deprecation_date have been updated
- Some tests for the date management have been included in a new test file _test_ec2deprecateimg.py_

- Test the package can still be built using ocs
- Test man page format has no errors
apozsuse added a commit that referenced this issue May 10, 2022
…g command

This change includes a new parameter (--deprecation-date) in the ec2deprecateimg
script to allow the user to override the default deprecation date (today's date).

[Issue 80](#80)

- As the requested param is optional, in case it's not included the behavior is
the one the script already had (defaulting to the execution date).
- When the parameter provided does not match the expected format (YYYYMMDD), the
script raises and exception, prints the error message and exits(1).

- _README.md_ file has been updated with the updated information.
- man page was updated to include the new param
- _ec2deprecateimg_:
  - The new parameter has been added to the argparse code
  - A new parameter with the deprecation date provided (or empty string if not provided)
  has been added to the initialization of EC2DeprecateImg class
  - As the class initialization can raise an exception (if the provided deprecation-date
  is not correct) the initialization has been included in a try-catch.
- _lib/ec2imgutils/ec2deprecateim.py_:
  - _set_deletion_date and _set_deprecation_date have been updated
- Some tests for the date management have been included in a new test file _test_ec2deprecateimg.py_

- Test the package can still be built using ocs
- Test man page format has no errors
apozsuse added a commit that referenced this issue May 10, 2022
…g command

This change includes a new parameter (--deprecation-date) in the ec2deprecateimg
script to allow the user to override the default deprecation date (today's date).

[Issue 80](#80)

- As the requested param is optional, in case it's not included the behavior is
the one the script already had (defaulting to the execution date).
- When the parameter provided does not match the expected format (YYYYMMDD), the
script raises and exception, prints the error message and exits(1).

- _README.md_ file has been updated with the updated information.
- man page was updated to include the new param
- _ec2deprecateimg_:
  - The new parameter has been added to the argparse code
  - A new parameter with the deprecation date provided (or empty string if not provided)
  has been added to the initialization of EC2DeprecateImg class
  - As the class initialization can raise an exception (if the provided deprecation-date
  is not correct) the initialization has been included in a try-catch.
- _lib/ec2imgutils/ec2deprecateim.py_:
  - _set_deletion_date and _set_deprecation_date have been updated
- Some tests for the date management have been included in a new test file _test_ec2deprecateimg.py_

- Test the package can still be built using ocs
- Test man page format has no errors
@apozsuse
Copy link
Contributor

Hi,

you can find the PR here

I was not able to test the locally built package in SLES 12 SP5 because out of the box there's no package to provide python3-boto3.

May be I should have added the backport repo and the package might be there ? 🤔

@smarlowucf
Copy link
Contributor Author

I think for SLES 12 we only provided python2 version of ec2imgutils. @rjschwei can correct me if wrong.

@apozsuse
Copy link
Contributor

Closing the issue as the change was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants