botify-labs / python-simple-workflow

DISCONTINUED - See README
http://python-simple-workflow.readthedocs.org/
MIT License
18 stars 4 forks source link

Let boto load its own configuration settings #46

Open mprecise opened 9 years ago

mprecise commented 9 years ago

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.

    # ~/.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
ggreg commented 9 years ago

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.