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
=== modified file 'README'
--- README 2012-06-05 17:18:17 +0000
+++ README 2013-02-05 15:51:23 +0000
@@ -109,7 +109,6 @@
109 {109 {
110 'type': 'datedir',110 'type': 'datedir',
111 'error_dir': '/var/log/oopses/',111 'error_dir': '/var/log/oopses/',
112 'instance_id': 'theinstance',
113 },112 },
114 ],113 ],
115 }114 }
@@ -147,7 +146,6 @@
147 {146 {
148 'type': 'datedir',147 'type': 'datedir',
149 'error_dir': '/var/log/oopses/',148 'error_dir': '/var/log/oopses/',
150 'instance_id': 'theinstance',
151 'new_only': True,149 'new_only': True,
152 },150 },
153 ],151 ],
@@ -206,7 +204,6 @@
206 [datedir_publisher]204 [datedir_publisher]
207 type = datedir205 type = datedir
208 error_dir = /var/log/oopses206 error_dir = /var/log/oopses
209 instance_id = theinstance
210 only_new = True207 only_new = True
211208
212209
213210
=== modified file 'oops_dictconfig/configglue_options.py'
--- oops_dictconfig/configglue_options.py 2012-06-05 17:18:17 +0000
+++ oops_dictconfig/configglue_options.py 2013-02-05 15:51:23 +0000
@@ -32,6 +32,7 @@
32 ),32 ),
33 instance_id=schema.StringOption(33 instance_id=schema.StringOption(
34 help="For datedir: an identifier for this instance.",34 help="For datedir: an identifier for this instance.",
35 default=None,
35 ),36 ),
36 host=schema.StringOption(37 host=schema.StringOption(
37 help="For amqp: the host:port for the amqp broker.",38 help="For amqp: the host:port for the amqp broker.",
3839
=== modified file 'oops_dictconfig/tests/__init__.py'
--- oops_dictconfig/tests/__init__.py 2012-02-02 22:18:43 +0000
+++ oops_dictconfig/tests/__init__.py 2013-02-05 15:51:23 +0000
@@ -17,6 +17,7 @@
1717
18def test_suite():18def test_suite():
19 module_names = [19 module_names = [
20 'oops_dictconfig.tests.test_configglue_options',
20 'oops_dictconfig.tests.test_dictconfig',21 'oops_dictconfig.tests.test_dictconfig',
21 ]22 ]
22 loader = unittest.TestLoader()23 loader = unittest.TestLoader()
2324
=== added file 'oops_dictconfig/tests/test_configglue_options.py'
--- oops_dictconfig/tests/test_configglue_options.py 1970-01-01 00:00:00 +0000
+++ oops_dictconfig/tests/test_configglue_options.py 2013-02-05 15:51:23 +0000
@@ -0,0 +1,19 @@
1from StringIO import StringIO
2
3from configglue.parser import SchemaConfigParser
4from configglue.schema import Schema
5from testtools import TestCase
6
7from oops_dictconfig.configglue_options import PublisherDescriptionOption
8
9
10class ConfigglueOptionsTests(TestCase):
11
12 def test_instance_id_default_None(self):
13 class TestSchema(Schema):
14 publisher = PublisherDescriptionOption()
15 parser = SchemaConfigParser(TestSchema())
16 section = '__main__'
17 parser.readfp(StringIO("[%s]" % section))
18 self.assertIs(None, parser.values()[section]['publisher']['instance_id'])
19
020
=== modified file 'tarmac_tests.sh'
--- tarmac_tests.sh 2012-02-24 21:22:56 +0000
+++ tarmac_tests.sh 2013-02-05 15:51:23 +0000
@@ -6,5 +6,5 @@
6virtualenv --no-site-packages virtualenv > log6virtualenv --no-site-packages virtualenv > log
7. virtualenv/bin/activate >> log7. virtualenv/bin/activate >> log
8python setup.py develop >> log8python setup.py develop >> log
9pip install testtools oops_amqp oops_datedir_repo9pip install testtools oops_amqp oops_datedir_repo configglue
10python -m testtools.run oops_dictconfig.tests.test_suite10python -m testtools.run oops_dictconfig.tests.test_suite

Subscribers

People subscribed via source and target branches