Skip to content

Commit

Permalink
Merge pull request #15 from savoirfairelinux/log-commands
Browse files Browse the repository at this point in the history
Add better logging
  • Loading branch information
Virgil Dupras committed Feb 6, 2015
2 parents 74f3d8f + dde12fe commit 36c35a5
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 41 deletions.
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

0 comments on commit 36c35a5

Please sign in to comment.