Remove context from remotable call signature

This is the final step in removing the context parameter from the
signature of a remotable method.

This includes a change of most of the object hashes, without version
bumps. That's because the hashing algorithm is just looking for changes
in things like a call signature, in order to signal that a version bump is
required. Since context is in the signature, removing it triggers the
alert. However, context is not _actually_ part of the on-the-wire API,
as it is stripped out on the caller side, and re-added on the callee side
(hence why we're making this change in the first place). If the test had
been uuber-pedantic to exclude context from consideration, then the hashes
would not be changing here, but alas.

In short, the hash changes are false alarms and do not mean we need
version bumps for all the things.

Related to blueprint kilo-objects

Change-Id: I89464c0ab7e6e0d84e677b9a69a86468727b6438
This commit is contained in:
Dan Smith
2015-03-13 10:17:45 -07:00
parent fdada5fcc2
commit b65106abd3

View File

@@ -60,7 +60,7 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject,
return cls._from_db_object(context, cls(), db_aggregate)
@base.remotable
def create(self, context):
def create(self):
if self.obj_attr_is_set('id'):
raise exception.ObjectActionError(action='create',
reason='already created')
@@ -83,7 +83,7 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject,
payload)
@base.remotable
def save(self, context):
def save(self):
self._assert_no_hosts('save')
updates = self.obj_get_changes()
@@ -101,7 +101,7 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject,
self._from_db_object(self._context, self, db_aggregate)
@base.remotable
def update_metadata(self, context, updates):
def update_metadata(self, updates):
payload = {'aggregate_id': self.id,
'meta_data': updates}
compute_utils.notify_about_aggregate_update(self._context,
@@ -128,11 +128,11 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject,
self.obj_reset_changes(fields=['metadata'])
@base.remotable
def destroy(self, context):
def destroy(self):
db.aggregate_delete(self._context, self.id)
@base.remotable
def add_host(self, context, host):
def add_host(self, host):
db.aggregate_host_add(self._context, self.id, host)
if self.hosts is None:
self.hosts = []
@@ -140,7 +140,7 @@ class Aggregate(base.NovaPersistentObject, base.NovaObject,
self.obj_reset_changes(fields=['hosts'])
@base.remotable
def delete_host(self, context, host):
def delete_host(self, host):
db.aggregate_host_delete(self._context, self.id, host)
self.hosts.remove(host)
self.obj_reset_changes(fields=['hosts'])