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 better logging #15

Merged
4 commits merged into from
Feb 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions client/sflvault/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,11 @@ def service_get(self, service_id, decrypt=True, group_id=None):

@authenticate(True)
def service_get_tree(self, service_id, with_groups=False):
"""Get information to be edited"""
"""Get information to be edited

:param service_id: Service id
:param with_groups: Retrieve groups information (deprecated)
"""
return self._service_get_tree(service_id, with_groups)

def _service_get_tree(self, service_id, with_groups=False):
Expand Down Expand Up @@ -958,7 +962,13 @@ def machine_put(self, machine_id, data):

@authenticate(True)
def show(self, service_id, verbose=False, with_groups=False):
"""Show informations to connect to a particular service"""
"""Show informations of a service

:param service_id: Service id
:param verbose: Display notes and additional information
:param with_groups: Retrieve groups information (deprecated)

"""
servs = self._service_get_tree(service_id, with_groups)
self._show(servs, verbose)

Expand All @@ -977,10 +987,11 @@ def _show(self, services, verbose=False):

secret = x['plaintext'] if 'plaintext' in x else '[access denied]'
print "%ss#%d %s" % (pre, x['id'], x['url'])
if x['groups_list']:
groups = ', '.join(["g#%s %s" % (g[0], g[1])
for g in x['groups_list']])
print "%s%s groups: %s" % (pre, spc, groups)
if verbose:
if x['groups_list']:
groups = ', '.join(["g#%s %s" % (g[0], g[1])
for g in x['groups_list']])
print "%s%s groups: %s" % (pre, spc, groups)
print "%s%s secret: %s" % (pre, spc, secret)

if verbose:
Expand Down
Loading