Merge pull request #217 from loles/readme_fixes

Readme fixes
This commit is contained in:
Jędrzej Nowak 2015-10-01 17:43:33 +02:00
commit 126f8c57e3
2 changed files with 12 additions and 10 deletions

View File

@ -78,7 +78,7 @@ solar resource create keystone_db_user resources/mariadb_user/ user_name=keyston
solar connect node1 mariadb_service
solar connect node1 keystone_db
solar connect mariadb_service keystone_db '{"root_password": "login_password", "port": "login_port"}'
solar connect mariadb_service keystone_db '{"root_password": "login_password", "port": "login_port", "ip": "db_host"}'
# solar connect mariadb_service keystone_db_user 'root_password->login_password port->login_port' # another valid format
solar connect keystone_db keystone_db_user

View File

@ -107,11 +107,13 @@ def init_cli_connect():
@click.argument('receiver')
@click.argument('mapping', default='')
def connect(mapping, receiver, emitter):
mapping_parsed = {}
click.echo('Connect {} to {}'.format(emitter, receiver))
mapping_parsed = None
emitter = sresource.load(emitter)
receiver = sresource.load(receiver)
click.echo('Connect {} to {}'.format(emitter, receiver))
if mapping:
mapping_parsed = {}
try:
mapping_parsed.update(json.loads(mapping))
except ValueError: