~ubuntu-branches/ubuntu/saucy/heat/saucy-updates

« back to all changes in this revision

Viewing changes to heat/engine/resources/rackspace/clouddatabase.py

  • Committer: Package Import Robot
  • Author(s): James Page, Chuck Short, James Page
  • Date: 2013-08-08 15:23:59 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130808152359-9jgqjp23kssvc3x9
Tags: 2013.2~b2.a186.g2b4b248-0ubuntu1
[ Chuck Short ]
* debian/patches/rename-quantumclient.patch: Dropped no longer needed. 
* debian/control: Add python-oslo.sphinx

[ James Page ]
* New upstream snapshot.
* d/watch: Updated to track releases on launchpad.
* d/control: Drop BD in pep8, no longer required.
* d/control,rules: Drop use of openstack-pkg-tools, revert use of xz
  compression for debs.
* d/control,*.config,*.templates,po: Drop use of debconf/dbconfig-common
  to configure heat.
* d/*.upstart: Add upstart configurations for Ubuntu.
* d/p/default-kombu.patch: Switch default messaging from qpid to
  kombu.
* d/p/default-sqlite.patch: Use sqlite as default database option.
* d/control: Add python-ceilometerclient to BD's.
* d/rules: Fail package build for unit test failures.
* d/*.install: Directly install configuration files to /etc/heat.
* d/control: Update VCS locations to ubuntu-server-dev branches.
* d/heat-common.{install,manpages}: Include new binaries and associated
  manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
                        'databases.' % missing_db}
216
216
        return
217
217
 
 
218
    def _hostname(self):
 
219
        if self.hostname is None and self.resource_id is not None:
 
220
            dbinstance = self.cloud_db().get(self.resource_id)
 
221
            self.hostname = dbinstance.hostname
 
222
 
 
223
        return self.hostname
 
224
 
 
225
    def _href(self):
 
226
        if self.href is None and self.resource_id is not None:
 
227
            dbinstance = self.cloud_db().get(self.resource_id)
 
228
            self.href = self._gethref(dbinstance)
 
229
 
 
230
        return self.href
 
231
 
 
232
    def _gethref(self, dbinstance):
 
233
        if dbinstance is None or dbinstance.links is None:
 
234
            return None
 
235
 
 
236
        for link in dbinstance.links:
 
237
            if link['rel'] == 'self':
 
238
                return link['href']
 
239
 
218
240
    def _resolve_attribute(self, name):
219
241
        if name == 'hostname':
220
 
            return self.hostname
 
242
            return self._hostname()
221
243
        elif name == 'href':
222
 
            return self.href
 
244
            return self._href()
 
245
        else:
 
246
            return None
223
247
 
224
248
 
225
249
# pyrax module is required to work with Rackspace cloud database provider.