Merge lp:~james-w/python-oops-dictconfig/instance-id-default into lp:python-oops-dictconfig

Proposed by James Westby
Status: Needs review
Proposed branch: lp:~james-w/python-oops-dictconfig/instance-id-default
Merge into: lp:python-oops-dictconfig
Diff against target: 86 lines (+22/-4)
5 files modified
README (+0/-3)
oops_dictconfig/configglue_options.py (+1/-0)
oops_dictconfig/tests/__init__.py (+1/-0)
oops_dictconfig/tests/test_configglue_options.py (+19/-0)
tarmac_tests.sh (+1/-1)
To merge this branch: bzr merge lp:~james-w/python-oops-dictconfig/instance-id-default
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Diogo Baeder (community) Approve
Review via email: mp+146477@code.launchpad.net

Commit message

Default instance_id to None, otherwise there's no way to specify the sentinel value.

Also remove the use of it in the examples, its use is deprecated, and we don't want
to give the impression that it should be used.

Description of the change

Hi,

This fixes a bug where if you used the configglue bindings for dictconfig
you would get the (deprecated) instance_id option set to '', whereas the
sentinel of None is desirable. This changes the default, so that you can
set instance_id if required, but the default will be to not use it.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Diogo Baeder (diogobaeder) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (11.4 KiB)

The attempt to merge lp:~james-w/python-oops-dictconfig/instance-id-default into lp:python-oops-dictconfig failed. Below is the output from the failed tests.

Downloading/unpacking testtools
  Running setup.py egg_info for package testtools

    no previously-included directories found matching 'doc/_build'
Downloading/unpacking oops-amqp
  Downloading oops_amqp-0.0.7.tar.gz
  Running setup.py egg_info for package oops-amqp

Downloading/unpacking oops-datedir-repo
  Downloading oops_datedir_repo-0.0.20.tar.gz
  Running setup.py egg_info for package oops-datedir-repo

Downloading/unpacking extras (from testtools)
  Downloading extras-0.0.3.tar.gz
  Running setup.py egg_info for package extras

Downloading/unpacking pymongo (from oops-amqp)
  Running setup.py egg_info for package pymongo

Requirement already satisfied (use --upgrade to upgrade): oops>=0.0.11 in ./virtualenv/lib/python2.7/site-packages/oops-0.0.13-py2.7.egg (from oops-amqp)
Downloading/unpacking amqplib (from oops-amqp)
  Running setup.py egg_info for package amqplib

Downloading/unpacking bson (from oops-datedir-repo)
  Downloading bson-0.3.3.tar.gz
  Running setup.py egg_info for package bson

Downloading/unpacking iso8601 (from oops-datedir-repo)
  Downloading iso8601-0.1.4.tar.gz
  Running setup.py egg_info for package iso8601

Downloading/unpacking launchpadlib (from oops-datedir-repo)
  Running setup.py egg_info for package launchpadlib

Requirement already satisfied (use --upgrade to upgrade): pytz in ./virtualenv/lib/python2.7/site-packages/pytz-2012j-py2.7.egg (from oops-datedir-repo)
Downloading/unpacking httplib2 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package httplib2

Downloading/unpacking keyring (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package keyring
    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/easy_install-zkfLHo/pytest-runner-1.2/hgtools-2.0.2-py2.7.egg

    Installed /mnt/tarmac/cache/python-oops-dictconfig/trunk/virtualenv/build/keyring/pytest_runner-1.2-py2.7.egg

    warning: no previously-included files found matching '.hg/last-message.txt'
Downloading/unpacking lazr.restfulclient>=0.9.19 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package lazr.restfulclient

Downloading/unpacking lazr.uri (from launchpadlib->oops-datedir-repo)
  Downloading lazr.uri-1.0.3.tar.gz
  Running setup.py egg_info for package lazr.uri

Downloading/unpacking oauth (from launchpadlib->oops-datedir-repo)
  Downloading oauth-1.0.1.tar.gz
  Running setup.py egg_info for package oauth

Requirement already satisfied (use --upgrade to upgrade): distribute in ./virtualenv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg (from launchpadlib->oops-datedir-repo)
Downloading/unpacking simplejson (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package simplejson

Downloading/unpacking testresources (from launchpadlib->oops-datedir-repo)
  Downloading testresources-0.2.7.tar.gz
  Running setup.py egg_info for package testresources

Downloading/unpacking wadllib (from launchpadl...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Voting does not meet specified criteria. Required: Approve >= 1, Disapprove == 0, Needs Fixing == 0, Needs Information == 0, Resubmit == 0, Pending == 0. Got: 1 Pending.

Revision history for this message
James Westby (james-w) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (11.4 KiB)

The attempt to merge lp:~james-w/python-oops-dictconfig/instance-id-default into lp:python-oops-dictconfig failed. Below is the output from the failed tests.

Downloading/unpacking testtools
  Running setup.py egg_info for package testtools

    no previously-included directories found matching 'doc/_build'
Downloading/unpacking oops-amqp
  Downloading oops_amqp-0.0.7.tar.gz
  Running setup.py egg_info for package oops-amqp

Downloading/unpacking oops-datedir-repo
  Downloading oops_datedir_repo-0.0.20.tar.gz
  Running setup.py egg_info for package oops-datedir-repo

Downloading/unpacking extras (from testtools)
  Downloading extras-0.0.3.tar.gz
  Running setup.py egg_info for package extras

Downloading/unpacking pymongo (from oops-amqp)
  Running setup.py egg_info for package pymongo

Requirement already satisfied (use --upgrade to upgrade): oops>=0.0.11 in ./virtualenv/lib/python2.7/site-packages/oops-0.0.13-py2.7.egg (from oops-amqp)
Downloading/unpacking amqplib (from oops-amqp)
  Running setup.py egg_info for package amqplib

Downloading/unpacking bson (from oops-datedir-repo)
  Downloading bson-0.3.3.tar.gz
  Running setup.py egg_info for package bson

Downloading/unpacking iso8601 (from oops-datedir-repo)
  Downloading iso8601-0.1.4.tar.gz
  Running setup.py egg_info for package iso8601

Downloading/unpacking launchpadlib (from oops-datedir-repo)
  Running setup.py egg_info for package launchpadlib

Requirement already satisfied (use --upgrade to upgrade): pytz in ./virtualenv/lib/python2.7/site-packages/pytz-2012j-py2.7.egg (from oops-datedir-repo)
Downloading/unpacking httplib2 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package httplib2

Downloading/unpacking keyring (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package keyring
    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/easy_install-idaq4V/pytest-runner-1.2/hgtools-2.0.2-py2.7.egg

    Installed /mnt/tarmac/cache/python-oops-dictconfig/trunk/virtualenv/build/keyring/pytest_runner-1.2-py2.7.egg

    warning: no previously-included files found matching '.hg/last-message.txt'
Downloading/unpacking lazr.restfulclient>=0.9.19 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package lazr.restfulclient

Downloading/unpacking lazr.uri (from launchpadlib->oops-datedir-repo)
  Downloading lazr.uri-1.0.3.tar.gz
  Running setup.py egg_info for package lazr.uri

Downloading/unpacking oauth (from launchpadlib->oops-datedir-repo)
  Downloading oauth-1.0.1.tar.gz
  Running setup.py egg_info for package oauth

Requirement already satisfied (use --upgrade to upgrade): distribute in ./virtualenv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg (from launchpadlib->oops-datedir-repo)
Downloading/unpacking simplejson (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package simplejson

Downloading/unpacking testresources (from launchpadlib->oops-datedir-repo)
  Downloading testresources-0.2.7.tar.gz
  Running setup.py egg_info for package testresources

Downloading/unpacking wadllib (from launchpadl...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (11.0 KiB)

The attempt to merge lp:~james-w/python-oops-dictconfig/instance-id-default into lp:python-oops-dictconfig failed. Below is the output from the failed tests.

Downloading/unpacking testtools
  Running setup.py egg_info for package testtools

    no previously-included directories found matching 'doc/_build'
Downloading/unpacking oops-amqp
  Downloading oops_amqp-0.0.7.tar.gz
  Running setup.py egg_info for package oops-amqp

Downloading/unpacking oops-datedir-repo
  Downloading oops_datedir_repo-0.0.20.tar.gz
  Running setup.py egg_info for package oops-datedir-repo

Downloading/unpacking configglue
  Downloading configglue-1.0.3.tar.gz
  Running setup.py egg_info for package configglue

Downloading/unpacking extras (from testtools)
  Downloading extras-0.0.3.tar.gz
  Running setup.py egg_info for package extras

Downloading/unpacking pymongo (from oops-amqp)
  Running setup.py egg_info for package pymongo

Requirement already satisfied (use --upgrade to upgrade): oops>=0.0.11 in ./virtualenv/lib/python2.7/site-packages/oops-0.0.13-py2.7.egg (from oops-amqp)
Downloading/unpacking amqplib (from oops-amqp)
  Running setup.py egg_info for package amqplib

Downloading/unpacking bson (from oops-datedir-repo)
  Downloading bson-0.3.3.tar.gz
  Running setup.py egg_info for package bson

Downloading/unpacking iso8601 (from oops-datedir-repo)
  Downloading iso8601-0.1.4.tar.gz
  Running setup.py egg_info for package iso8601

Downloading/unpacking launchpadlib (from oops-datedir-repo)
  Running setup.py egg_info for package launchpadlib

Requirement already satisfied (use --upgrade to upgrade): pytz in ./virtualenv/lib/python2.7/site-packages/pytz-2012j-py2.7.egg (from oops-datedir-repo)
Downloading/unpacking pyxdg (from configglue)
  Running setup.py egg_info for package pyxdg

Downloading/unpacking httplib2 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package httplib2

Downloading/unpacking keyring (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package keyring
    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/easy_install-7hjk_j/pytest-runner-1.2/hgtools-2.0.2-py2.7.egg

    Installed /mnt/tarmac/cache/python-oops-dictconfig/trunk/virtualenv/build/keyring/pytest_runner-1.2-py2.7.egg

    warning: no previously-included files found matching '.hg/last-message.txt'
Downloading/unpacking lazr.restfulclient>=0.9.19 (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package lazr.restfulclient

Downloading/unpacking lazr.uri (from launchpadlib->oops-datedir-repo)
  Downloading lazr.uri-1.0.3.tar.gz
  Running setup.py egg_info for package lazr.uri

Downloading/unpacking oauth (from launchpadlib->oops-datedir-repo)
  Downloading oauth-1.0.1.tar.gz
  Running setup.py egg_info for package oauth

Requirement already satisfied (use --upgrade to upgrade): distribute in ./virtualenv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg (from launchpadlib->oops-datedir-repo)
Downloading/unpacking simplejson (from launchpadlib->oops-datedir-repo)
  Running setup.py egg_info for package simplejson
  ...

Unmerged revisions

12. By James Westby

Add configglue to the extra test dependencies we install.

11. By James Westby

Add the missing file.

10. By James Westby

Default instance_id to None, otherwise there's no way to specify the sentinel value.

Also remove the use of it in the examples, its use is deprecated, and we don't want
to give the impression that it should be used.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2012-06-05 17:18:17 +0000
3+++ README 2013-02-05 15:51:23 +0000
4@@ -109,7 +109,6 @@
5 {
6 'type': 'datedir',
7 'error_dir': '/var/log/oopses/',
8- 'instance_id': 'theinstance',
9 },
10 ],
11 }
12@@ -147,7 +146,6 @@
13 {
14 'type': 'datedir',
15 'error_dir': '/var/log/oopses/',
16- 'instance_id': 'theinstance',
17 'new_only': True,
18 },
19 ],
20@@ -206,7 +204,6 @@
21 [datedir_publisher]
22 type = datedir
23 error_dir = /var/log/oopses
24- instance_id = theinstance
25 only_new = True
26
27
28
29=== modified file 'oops_dictconfig/configglue_options.py'
30--- oops_dictconfig/configglue_options.py 2012-06-05 17:18:17 +0000
31+++ oops_dictconfig/configglue_options.py 2013-02-05 15:51:23 +0000
32@@ -32,6 +32,7 @@
33 ),
34 instance_id=schema.StringOption(
35 help="For datedir: an identifier for this instance.",
36+ default=None,
37 ),
38 host=schema.StringOption(
39 help="For amqp: the host:port for the amqp broker.",
40
41=== modified file 'oops_dictconfig/tests/__init__.py'
42--- oops_dictconfig/tests/__init__.py 2012-02-02 22:18:43 +0000
43+++ oops_dictconfig/tests/__init__.py 2013-02-05 15:51:23 +0000
44@@ -17,6 +17,7 @@
45
46 def test_suite():
47 module_names = [
48+ 'oops_dictconfig.tests.test_configglue_options',
49 'oops_dictconfig.tests.test_dictconfig',
50 ]
51 loader = unittest.TestLoader()
52
53=== added file 'oops_dictconfig/tests/test_configglue_options.py'
54--- oops_dictconfig/tests/test_configglue_options.py 1970-01-01 00:00:00 +0000
55+++ oops_dictconfig/tests/test_configglue_options.py 2013-02-05 15:51:23 +0000
56@@ -0,0 +1,19 @@
57+from StringIO import StringIO
58+
59+from configglue.parser import SchemaConfigParser
60+from configglue.schema import Schema
61+from testtools import TestCase
62+
63+from oops_dictconfig.configglue_options import PublisherDescriptionOption
64+
65+
66+class ConfigglueOptionsTests(TestCase):
67+
68+ def test_instance_id_default_None(self):
69+ class TestSchema(Schema):
70+ publisher = PublisherDescriptionOption()
71+ parser = SchemaConfigParser(TestSchema())
72+ section = '__main__'
73+ parser.readfp(StringIO("[%s]" % section))
74+ self.assertIs(None, parser.values()[section]['publisher']['instance_id'])
75+
76
77=== modified file 'tarmac_tests.sh'
78--- tarmac_tests.sh 2012-02-24 21:22:56 +0000
79+++ tarmac_tests.sh 2013-02-05 15:51:23 +0000
80@@ -6,5 +6,5 @@
81 virtualenv --no-site-packages virtualenv > log
82 . virtualenv/bin/activate >> log
83 python setup.py develop >> log
84-pip install testtools oops_amqp oops_datedir_repo
85+pip install testtools oops_amqp oops_datedir_repo configglue
86 python -m testtools.run oops_dictconfig.tests.test_suite

Subscribers

People subscribed via source and target branches