Skip to content

Option to specify profile - #1420

Open
railadeividas wants to merge 3 commits into
s3tools:masterfrom
railadeividas:master
Open

railadeividas wants to merge 3 commits into
s3tools:masterfrom
railadeividas:master

Conversation

@railadeividas

@railadeividas railadeividas commented Apr 3, 2025 •

Copy link
Copy Markdown

Allow having few profiles in default config .s3cfg

@deividasraila

Copy link
Copy Markdown

@fviard please check

@fviard fviard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your PR that is quite good and would solve an issue that is encountered by quite a few users and sorry for the long delay for my feedback.

If it would still be possible for you, there is a little change of behavior for this feature that I would prefer:

  • Currently, for the s3cfg file, it will read one section or another (so either the default or the profile one).
  • I think that it would be better to always try to load the "default" section, and to then optionally load the "profile" on top of that.
  • It would probably be easy to do a first version with a slight modification of your code.
    Something like creating the ConfigParser with the "[default]" sections, and then if there is the profile, use the "parse_file(...)" function of this cp instance with the "profile" as [sections].

I think that it would be better because if you have to copy paste all the common options in all your profiles, there is not that much any interest compared to use multiple config files. But with this, you could have a common (default) config and just put the specific parts inside each profile.

I added 2 nitpicks directly in review comments.

Comment thread S3/Config.py Outdated
Comment thread S3/Config.py
@fviard fviard added this to the 2.4.1 milestone Oct 27, 2025
@deividasraila

Copy link
Copy Markdown

@fviard I have updated and tested the code to always load default.

Comment thread S3/Config.py Outdated
Comment thread S3/Config.py Outdated
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

Successfully merging this pull request may close these issues.

5 participants