Skip to content

Commit

Permalink
Fix missing source field content on /v2/samples API
Browse files Browse the repository at this point in the history
Also fix example Sample in API doc

Closes-Bug: #1282176

Change-Id: I322aa57c0e8f83f9b220cf544378eb5e183df134
  • Loading branch information
Balazs Gibizer committed Feb 19, 2014
1 parent 7091966 commit 0fb1ca7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ceilometer/api/controllers/v2.py
Expand Up @@ -910,6 +910,7 @@ def from_db_model(cls, m):
user_id=m.user_id,
project_id=m.project_id,
resource_id=m.resource_id,
source=m.source,
timestamp=m.timestamp,
metadata=_flatten_metadata(m.resource_metadata))

Expand All @@ -919,6 +920,7 @@ def sample(cls):
meter='instance',
type='gauge',
unit='instance',
volume=1,
resource_id='bd9431c1-8d69-4ad3-803a-8d4a6b89fd36',
project_id='35b17138-b364-4e6a-a131-8f3099c5be68',
user_id='efd87807-12d2-4b38-9c70-5f5c2ac427ff',
Expand Down
2 changes: 2 additions & 0 deletions ceilometer/tests/api/v2/test_list_meters_scenarios.py
Expand Up @@ -209,6 +209,7 @@ def test_get_one_sample(self):
u'timestamp': u'2012-07-02T11:40:00',
u'type': u'cumulative',
u'unit': u'',
u'source': 'test_source',
u'user_id': u'user-id',
u'volume': 3.0})

Expand Down Expand Up @@ -237,6 +238,7 @@ def test_list_samples_with_dict_metadata(self):
u'project_id': u'project-id2',
u'type': u'gauge',
u'unit': u'',
u'source': u'test_source1',
u'metadata': {u'display_name': u'test-server',
u'properties.prop_2:sub_prop_1': u'sub_prop_value',
u'util': u'0.58',
Expand Down

0 comments on commit 0fb1ca7

Please sign in to comment.