Merge lp:~charlesk/pay-service/silence-prices-warning into lp:pay-service/15.04

Proposed by Charles Kerr
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~charlesk/pay-service/silence-prices-warning
Merge into: lp:pay-service/15.04
Diff against target: 36 lines (+12/-3)
2 files modified
libpay/internal/package.cpp (+8/-3)
tests/com_canonical_pay_store.py (+4/-0)
To merge this branch: bzr merge lp:~charlesk/pay-service/silence-prices-warning
Reviewer Review Type Date Requested Status
dobey (community) Needs Resubmitting
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+278167@code.launchpad.net

Commit message

in libpay's create_pay_item_from_variant(), don't warn on some unhandled properties, e.g. 'prices'

Description of the change

in libpay's create_pay_item_from_variant(), don't warn on some unhandled properties, e.g. 'prices'

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

This needs to be re-created against lp:pay-service as we are set up for dual landing now, so landing into the 15.04 branch only shouldn't be done.

review: Needs Resubmitting

Unmerged revisions

54. By Charles Kerr

in libpay's create_pay_item_from_variant(), don't warn on some properties, e.g. 'prices'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libpay/internal/package.cpp'
--- libpay/internal/package.cpp 2015-11-03 21:06:49 +0000
+++ libpay/internal/package.cpp 2015-11-20 16:09:56 +0000
@@ -286,9 +286,14 @@
286 }286 }
287 else287 else
288 {288 {
289 auto valstr = g_variant_print(value, true);289 const std::set<std::string> silent {"prices"};
290 g_warning("Unhandled item property '%s': '%s'", key, valstr);290
291 g_free(valstr);291 if ((key != nullptr) && !silent.count(key))
292 {
293 auto valstr = g_variant_print(value, true);
294 g_warning("Unhandled item property '%s': '%s'", key, valstr);
295 g_free(valstr);
296 }
292 }297 }
293 }298 }
294 }299 }
295300
=== modified file 'tests/com_canonical_pay_store.py'
--- tests/com_canonical_pay_store.py 2015-11-03 21:06:49 +0000
+++ tests/com_canonical_pay_store.py 2015-11-20 16:09:56 +0000
@@ -61,6 +61,10 @@
61 'completed_timestamp': dbus.UInt64(0.0),61 'completed_timestamp': dbus.UInt64(0.0),
62 'description': dbus.String('The is a default item'),62 'description': dbus.String('The is a default item'),
63 'price': dbus.String('$1'),63 'price': dbus.String('$1'),
64 'prices': {
65 dbus.String("USD"): dbus.String("$1"),
66 dbus.String("GBP"): dbus.String("£1")
67 },
64 'purchase_id': dbus.UInt64(0.0),68 'purchase_id': dbus.UInt64(0.0),
65 'refundable_until': dbus.UInt64(0.0),69 'refundable_until': dbus.UInt64(0.0),
66 'sku': dbus.String('default_item'),70 'sku': dbus.String('default_item'),

Subscribers

People subscribed via source and target branches

to all changes: