Skip to content

Instantly share code, notes, and snippets.

@terriyu
Created August 14, 2013 06:56
Show Gist options
  • Select an option

  • Save terriyu/6228607 to your computer and use it in GitHub Desktop.

Select an option

Save terriyu/6228607 to your computer and use it in GitHub Desktop.
Journal for OpenStack Ceilometer work -- 9 Aug 2013

9 Aug 2013

Patches I submitted

Unused variable self.counters in storage tests

The list variable self.counters is created and appended to, in the storage test class StatisticsTest of tests/storage/base.py

However, the variable never does anything useful, as far as I can tell.

Bug report: https://bugs.launchpad.net/ceilometer/+bug/1210278

I deleted all references to self.counters in tests/storage/base.py in this patch.

Patch: https://review.openstack.org/#/c/40983/

Update:

Sandy Walsh gave me a +1 on this patch with comment

Yes, remove more code!

Mehdi Abaakouk (core developer) gave me a +2 as well

Unused abstract class definitions in storage tests

DBTestBase and EventTestBase are defined as abstract classes in tests/storage/base.py

However, neither of these classes has defined any abstract methods, so the abstract class definitions are unnecessary.

Bug report: https://bugs.launchpad.net/ceilometer/+bug/1210281

Removed abstract classes definitions from DBTestBase and EventTestBase classes in storage driver tests and also removed import statement for abstract base classes since there are now no abstract class definitions.

Patch: https://review.openstack.org/#/c/41000/

Update:

Sandy Walsh gave me a +1 on this patch with comment

Makes sense ... thanks for that.

Ceilometer test failures due to MongoDB version

When I ran the Ceilometer test suite after pulling the latest changes, I got failures due to my MongoDB version being too old. The error was StorageBadVersion: Need at least MongoDB 2.2

The test results from running the Ceilometer test suite: https://gist.github.com/terriyu/6228249

I'm running Ubuntu 12.04 in my VM and the Ubuntu version of the MongoDB package is still 2.0.4 : http://packages.ubuntu.com/precise/mongodb

Previously, jd told me to avoid vendor packages, so I asked jd what to do. He said in this case, I should install the vendor package from 10gen. The install instructions are here: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

jd said that he put in request for the Ubuntu package to be updated, but nothing has happened yet. The alternative is to upgrade my Ubuntu operating system. Ubuntu 13.04 and 13.10 have Ubuntu MongoDB packages that are version 2.2 and higher.

My solution was to keep using Ubuntu 12.04 on my VM and install the 10gen MongoDB packages. However, I have to remove the Ubuntu packages that Devstack installed by doing

sudo apt-get remove mongodb-server mongodb-client
sudo apt-get purge mongodb-server

The second line is needed because for some reason, when I run dpkg --get-selections | grep mongodb, the package mongodb-server is still in the list of entries.

sileht said that he edits his forked Devstack repo to remove the reference to mongodb-server in files/apts/ceilometer-collector

https://github.com/sileht/devstack/commit/d2a44be0a10212a5a2eea6c6a27fc02b9e023966

Following his idea, I edited my copy of files/apts/ceilometer-collector and removed the line with mongodb-server.

MongoDB PyMongo username/password warnings

When I run the Ceilometer tests, they pass, but I get several hundred MongoDB/PyMongo username/password warnings saying:

/opt/stack/ceilometer/.tox/py27/local/lib/python2.7/site-packages/pymongo/mongo_client.py:343: UserWarning: database name or authSource in URI is being ignored. If you wish to authenticate to ceilometer_546ebb9cf3394503b856276360660c47, you must provide a username and password.

jd says:

That's just a warning because pymongo ignore the some parameters in the database URL we give it during the test, don't worry.

I thought that maybe the username and password warnings had something to do with my Keystone configuration.

jd says:

That's unrelated anyway, the unit test never uses the ceilometer.conf file. That'd be dangerous, you could have test only passing with certain configuration parameter otherwise that we wouldn't be able to reproduce. So every configuration option we would beed to tweak for a test is in the unit test code.

jd told me to report this bug and he will look into it.

Reported bug here: https://bugs.launchpad.net/ceilometer/+bug/1210674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment