python-simple-workflow icon indicating copy to clipboard operation
python-simple-workflow copied to clipboard

Let boto load its own configuration settings

Open mprecise opened this issue 10 years ago • 1 comments

It may have been an intentional choice, but boto's config file and simple-workflow's config file are in slightly different formats. Since boto is the underlying library making the connections, it seems logical to me to use the boto config file for credentials and swf region instead of a library-specific settings file. The boto config reference is at http://boto.readthedocs.org/en/latest/boto_config_tut.html.

Here are differences I've found. All of these are of course not relevant if you decide to use the settings that boto loads.

  1. simple-workflow looks for ~/.swf by default. boto looks in several places, as mentioned in the above link, but the location for the current user is at ~/.boto by default.

  2. There appears to be no way to easily override the settings location. I guess you could do the following before making any connections.

    import swf.core
    import swf.settings
    swf.core.SETTINGS = swf.settings.get('alternate_settings_file')
    

    However, if you let boto load its own config file instead, I don't think you'd need to load your own settings file at all.

  3. The key names are different between boto and simple-workflow formats. Again, see http://boto.readthedocs.org/en/latest/boto_config_tut.html.

    • I believe ConfigParser uses case-sensitive section names, but case-insensitive keys, at least that's what Python 3.4 documentation says https://docs.python.org/3/library/configparser.html#supported-ini-file-structure. I believe it's the same for Python 2.7 as well. That means "credentials" and "Credentials" aren't compatible.
    • defaults vs SWF for the second section name
    # ~/.swf
    [credentials]
    aws_access_key_id = youraccesskey
    aws_secret_access_key = yoursecret
    
    [defaults]
    region = yourregion
    
    # ~/.boto
    [Credentials]
    aws_access_key_id = youraccesskey
    aws_secret_access_key = yoursecret
    
    [SWF]
    region = yourregion
    

mprecise avatar Apr 15 '15 02:04 mprecise

Thanks for reporting this issue. I do not remember the rationale for the specific .swf configuration file. simple-workflow should simply rely on boto's authentication.

ggreg avatar Apr 19 '15 23:04 ggreg