~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/migrate_repo/versions/147_no_service_zones.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2013-03-20 12:59:22 UTC
  • mfrom: (1.1.69)
  • Revision ID: package-import@ubuntu.com-20130320125922-ohvfav96lemn9wlz
Tags: 1:2013.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/avoid_setuptools_git_dependency.patch: Refreshed.
* debian/control: Clean up dependencies:
  - Dropped python-gflags no longer needed.
  - Dropped python-daemon no longer needed.
  - Dropped python-glance no longer needed.
  - Dropped python-lockfile no longer needed.
  - Dropped python-simplejson no longer needed.
  - Dropped python-tempita no longer needed.
  - Dropped python-xattr no longer needed.
  - Add sqlite3 required for the testsuite.

[ James Page ]
* d/watch: Update uversionmangle to deal with upstream versioning
  changes, remove tarballs.openstack.org. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012 OpenStack LLC.
 
1
# Copyright 2012 OpenStack Foundation
2
2
#
3
3
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
4
#    not use this file except in compliance with the License. You may obtain
58
58
                        })
59
59
        # add host to zone
60
60
        agg_hosts = Table('aggregate_hosts', meta, autoload=True)
61
 
        row = agg_hosts.insert()
62
 
        row.execute({'host': rec['host'], 'aggregate_id': agg_id})
 
61
        num_hosts = agg_hosts.count().where(
 
62
            agg_hosts.c.host == rec['host']).where(
 
63
            agg_hosts.c.aggregate_id == agg_id).execute().scalar()
 
64
        if num_hosts == 0:
 
65
            agg_hosts.insert().execute({'host': rec['host'],
 
66
                                        'aggregate_id': agg_id})
63
67
 
64
68
    services.drop_column('availability_zone')
65
69