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

Make it possible to disable stats collection #58

Merged
merged 1 commit into from
Sep 18, 2018
Merged
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
7 changes: 5 additions & 2 deletions theblues/charmstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ def _meta(self, entity_id, includes, channel=None):
data = self._get(url)
return data.json()

def entity(self, entity_id, get_files=False, channel=None):
def entity(self, entity_id, get_files=False, channel=None,
include_stats=True):
'''Get the default data for any entity (e.g. bundle or charm).

@param entity_id The entity's id either as a reference or a string
@param get_files Whether to fetch the files for the charm or not.
@param channel Optional channel name.
@param include_stats Optionally disable stats collection
'''
includes = [
'bundle-machine-count',
Expand All @@ -129,13 +131,14 @@ def entity(self, entity_id, get_files=False, channel=None):
'owner',
'revision-info',
'published',
'stats',
'resources',
'supported-series',
'terms'
]
if get_files:
includes.append('manifest')
if include_stats:
includes.append('stats')
return self._meta(entity_id, includes, channel=channel)

def entities(self, entity_ids):
Expand Down