def vacuum(verbose=False):
 ret = {}
 imgadm = _check_imgadm()
 cmd = '{0} vacuum -f'.format(imgadm)
 res = __salt__['cmd.run_all'](cmd)
 retcode = res['retcode']
 if (retcode != 0):
  ret['Error'] = _exit_status(retcode)
  return ret
 result = {}
 for image in res['stdout'].splitlines():
  image = [var for var in image.split(' ') if var]
  result[image[2]] = {'name': image[3][1:image[3].index('@')], 'version': image[3][(image[3].index('@') + 1):(-1)]}
 if verbose:
  return result
 else:
  return list(result.keys())

def vacuum ( verbose = False ) : ret = { } imgadm = _check_imgadm ( ) cmd = '{0} vacuum -f' . format ( imgadm ) res = __salt__ [ 'cmd.run_all' ] ( cmd ) retcode = res [ 'retcode' ] if ( retcode != 0 ) : ret [ 'Error' ] = _exit_status ( retcode ) return ret result = { } for image in res [ 'stdout' ] . splitlines ( ) : image = [ var for var in image . split ( ' ' ) if var ] result [ image [ 2 ] ] = { 'name' : image [ 3 ] [ 1 : image [ 3 ] . index ( '@' ) ] , 'version' : image [ 3 ] [ ( image [ 3 ] . index ( '@' ) + 1 ) : ( - 1 ) ] } if verbose : return result else : return list ( result . keys ( ) )
remove unused images verbose : boolean toggle verbose output cli example: .