diff options
author | Caio Carrara <ccarrara@thoughtworks.com> | 2016-05-11 16:24:46 -0300 |
---|---|---|
committer | Caio Carrara <ccarrara@thoughtworks.com> | 2016-05-11 16:24:46 -0300 |
commit | c5f92efdd19464b876e56750f85a6d8ba4d7b558 (patch) | |
tree | 27153897785261460f7bd9fa3a7c588eb1d5137a /service/pixelated/config | |
parent | a23d3bebc0c879682f7d70b2a8451cc98b2d70ab (diff) |
Remove dispatcher references from service
Since we're not using dispatcher anymore, it doesn't make sense to keep
dispatcher references and program flows that depend on it. For example,
it doesn't make sense keep the flag --organization-mode, so it was
removed as well.
Diffstat (limited to 'service/pixelated/config')
-rw-r--r-- | service/pixelated/config/arguments.py | 3 | ||||
-rw-r--r-- | service/pixelated/config/credentials.py | 16 | ||||
-rw-r--r-- | service/pixelated/config/leap.py | 5 |
3 files changed, 5 insertions, 19 deletions
diff --git a/service/pixelated/config/arguments.py b/service/pixelated/config/arguments.py index abd5d881..d001d803 100644 --- a/service/pixelated/config/arguments.py +++ b/service/pixelated/config/arguments.py @@ -24,10 +24,7 @@ def parse_user_agent_args(): parser_add_default_arguments(parser) parser.add_argument('--host', default='127.0.0.1', help='the host to run the user agent on') - parser.add_argument('--organization-mode', help='Runs the user agent in organization mode, the credentials will be received from the stdin', default=False, action='store_true', dest='organization_mode') parser.add_argument('--port', type=int, default=3333, help='the port to run the user agent on') - parser.add_argument('-sk', '--sslkey', metavar='<server.key>', default=None, help='use specified file as web server\'s SSL key (when using the user-agent together with the pixelated-dispatcher)') - parser.add_argument('-sc', '--sslcert', metavar='<server.crt>', default=None, help='use specified file as web server\'s SSL certificate (when using the user-agent together with the pixelated-dispatcher)') parser.add_argument('--multi-user', help='Run user agent in multi user mode', action='store_false', default=True, dest='single_user') parser.add_argument('-p', '--provider', help='specify a provider for mutli-user mode', metavar='<provider host>', default=None, dest='provider') parser.add_argument('--banner', help='banner file to show on login screen') diff --git a/service/pixelated/config/credentials.py b/service/pixelated/config/credentials.py index a6da86e6..89901b3f 100644 --- a/service/pixelated/config/credentials.py +++ b/service/pixelated/config/credentials.py @@ -21,13 +21,10 @@ import sys import ConfigParser -def read(organization_mode, credentials_file): - if organization_mode: - return read_from_dispatcher() - else: - if credentials_file: - return read_from_file(credentials_file) - return prompt_for_credentials() +def read(credentials_file): + if credentials_file: + return read_from_file(credentials_file) + return prompt_for_credentials() def prompt_for_credentials(): @@ -46,8 +43,3 @@ def read_from_file(credentials_file): config_parser.get('pixelated', 'leap_username'), \ config_parser.get('pixelated', 'leap_password') return provider, user, password - - -def read_from_dispatcher(): - config = json.loads(sys.stdin.read()) - return config['leap_provider_hostname'], config['user'], config['password'] diff --git a/service/pixelated/config/leap.py b/service/pixelated/config/leap.py index 17a69406..f61d3af7 100644 --- a/service/pixelated/config/leap.py +++ b/service/pixelated/config/leap.py @@ -30,7 +30,6 @@ def initialize_leap_multi_user(provider_hostname, leap_provider_cert, leap_provider_cert_fingerprint, credentials_file, - organization_mode, leap_home): config, provider = initialize_leap_provider(provider_hostname, leap_provider_cert, leap_provider_cert_fingerprint, leap_home) @@ -69,15 +68,13 @@ def authenticate_user(provider, username, password, initial_sync=True, auth=None def initialize_leap_single_user(leap_provider_cert, leap_provider_cert_fingerprint, credentials_file, - organization_mode, leap_home, initial_sync=True): init_monkeypatches() events_server.ensure_server() - provider, username, password = credentials.read(organization_mode, - credentials_file) + provider, username, password = credentials.read(credentials_file) config, provider = initialize_leap_provider(provider, leap_provider_cert, leap_provider_cert_fingerprint, leap_home) |