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 EnvironmentConfig class #17

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

msabramo
Copy link
Contributor

Fixes: GH-16
Also takes care of the environment variable stuff I was trying to address in #11, but does it in a cleaner way.

$ SERF_RPC_ADDR=serf.company.com:6464 SERF_RPC_AUTH="secret" ipython
Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
Type "copyright", "credits" or "license" for more information.

IPython 2.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from serfclient import EnvironmentConfig

In [2]: environment = EnvironmentConfig()

In [3]: environment.host
Out[3]: 'serf.company.com'

In [4]: environment.port
Out[4]: 6464

In [5]: environment.auth_key
Out[5]: 'secret'

@@ -1,6 +1,7 @@
from pkg_resources import get_distribution
from serfclient.client import SerfClient
from serfclient.environmentconfig import EnvironmentConfig
Copy link
Owner

Choose a reason for hiding this comment

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

Can you move this into a file called environment_config please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

KushalP added a commit that referenced this pull request Jun 17, 2015
@KushalP KushalP merged commit c27664e into KushalP:master Jun 17, 2015
msabramo added a commit to msabramo/ansible that referenced this pull request Jun 17, 2015
using newly added `EnvironmentConfig` class in `serfclient`.

See KushalP/serfclient-py#17
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.

2 participants